Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *  Copyright (c) 2011 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 GNU Lesser Public License v2.1
   *  which accompanies this distribution, and is available at
   *  http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
   *
   *  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.editor;
 
 
 
The LegalPersonDialog can be used to edit LegalPerson, which implements the MetadataeditDialog class, we can use it with a couple of lines of code:

   LegalPersonDialog personDialog = new LegalPersonDialog(person,title); 
   personDialog.showOpenDialog();
  

Author(s):
Jinbo Chen
Version:
1.0
 
 public class LegalPersonDialog extends MetaDataEditDialog{
 	private static final long serialVersionUID = 1L;
 	
 	private JLabel surnamelabel;
 	private JLabel givennamelabel;
 	private JLabel addresslabel;
 	private JLabel ziplabel;
 	private JTextField ziptext;
 	private JLabel countrylabel;
 	private JLabel legalnamelabel;
 	private JTextField legalnametext
 	private LegalPerson person;
 	private int layoutindex = 1;

Constructs a LegalPersonDialog that is initialized with person.

Parameters:
person Person object to show in LegalPersonDialog
  
 	public LegalPersonDialog(LegalPerson person,String title)
 	{
 		super();
 		
 		this. = person;
 		
 		setTitle(title);
 		
 		
 		JPanel contents = (JPanelgetContentPane();
 		contents.setLayout(new BorderLayout());
 		
 		final JPanel editPane = new JPanel();		
 		final GridBagLayout gridbag = new GridBagLayout();
 		editPane.setLayout(gridbag);		
 		
 		buildlegalperonui(gridbageditPane);
 		
 		contents.add(editPane,.);
 		
 		
 		this.setMinimumSize(new Dimension(400,(int)(400*0.618)));
 		
 	}
 	
 	private void buildcommonsui(GridBagLayout gridbag,JPanel editPane)
 	{
 		if(!=null)
 		{
 			editPane.remove();
 		}
 		if(!=null)
 		{
 			editPane.remove();
 		}
 		
 		if(!=null)
		{
			editPane.remove();
		}
		if(!=null)
		{
			editPane.remove();
		}
		if(!=null)
		{
		}
		if(!=null)
		{
		}
		c.insets = new Insets(0,0,3,0);
		 = new JLabel("Address:");
		c.gridx=0;
        c.gridy=;	
        c.gridheight=1;
        c.gridwidth=1;
        c.weightx= 0;
    	gridbag.setConstraints(c);
		editPane.add();
		c.gridx=1;
        c.gridy=;	
        c.gridheight=1;
        c.gridwidth=2;
        c.weightx=1.0;
    	gridbag.setConstraints(c);
		editPane.add();
		 = new JLabel("Zip:");
		c.gridx=0;
        c.gridy=;	
        c.gridheight=1;
        c.gridwidth=1;
        c.weightx= 0;
    	gridbag.setConstraints(c);
		editPane.add();
		 = new JTextField();
		c.gridx=1;
        c.gridy=;	
        c.gridheight=1;
        c.gridwidth=2;
        c.weightx=1.0;
    	gridbag.setConstraints(c);		
		editPane.add();
		 = new JLabel("Country:");
		c.gridx=0;
        c.gridy=;	
        c.gridheight=1;
        c.gridwidth=1;
        c.weightx= 0;
    	gridbag.setConstraints(c);
		editPane.add();
		c.gridx=1;
        c.gridy=;	
        c.gridheight=1;
        c.gridwidth=2;
        c.weightx=1.0;
    	gridbag.setConstraints(c);		
		editPane.add();
	}
	private void buildlegalperonui(GridBagLayout gridbag,JPanel editPane)
	{
		if(!=null)
		{
		}
		if(!=null)
		{
		}
		{
		}
		if(!=null)
		{
		}
		c.insets = new Insets(0,0,3,0);
		c.gridx=0;
        c.gridy=;		
        c.gridheight=1;
        c.gridwidth=1;	
        c.weightx= 0;
         = new JLabel("LegalName:");
		c.gridx=1;
        c.gridy=;	
        c.gridheight=1;
        c.gridwidth=2;
        c.weightx=1.0;
    	gridbag.setConstraints(c);
		editPane.add();
		buildcommonsui(gridbag,editPane);
	}
	public void initdata()
	{
		if(!=null)
		{
		}
	}

Returns the Person inputted by user.

Returns:
the Person inputted by user.
	{
		return newperson;	
	}
New to GrepCode? Check out our FAQ X