Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2015 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)
  * which accompanies this distribution, and is available at http://creativecommons.org/licenses/by-nd/4.0/
  *
  * Contributors:
  *      Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany - RMI Client, FileChooser and WebDAV
  */
package de.ipk_gatersleben.bit.bi.edal.rmi.client.gui.viewer;
The TextviewDialog can be used to edit text information, which implements the MetadataviewDialog class, we can use it with a couple of lines of code:

   TextviewDialog textviewDialog = new TextviewDialog(text); 
   textviewDialog.showOpenDialog();
  

Author(s):
Jinbo Chen
Version:
1.0
public class TextViewDialog extends MetadataViewDialog{
	private static final long serialVersionUID = 1L;
	private JTextArea textarea;
	private String _text;

Constructs a TextviewDialog that is initialized with String

Parameters:
text Text information to show in TextviewDialog
 
	public TextViewDialog(String text,String title)
	{
		super();
		this. = text;		
		setTitle(title);
		JPanel contents = (JPanelgetContentPane();
		contents.setLayout(new BorderLayout());
		JPanel editPane = new JPanel();	
		editPane.setLayout(new BorderLayout());
		 = new JTextArea();
		editPane.add(scroll,.);
		contents.add(editPane,.);
		this.setMinimumSize(new Dimension(350,(int)(350*0.618)));
	}
	public void initdata()
	{
		if(!=null)
		{
		}
	}
Returns the Text information inputted by user.

Returns:
the Text information inputted by user.
	public String getText()
	{
		return .getText();
	}
New to GrepCode? Check out our FAQ X