List of usage examples for javax.swing JPanel setBorder
@BeanProperty(preferred = true, visualUpdate = true, description = "The component's border.") public void setBorder(Border border)
From source file:com.orthancserver.SelectImageDialog.java
public SelectImageDialog() { tree_ = new JTree(); tree_.addTreeWillExpandListener(new TreeWillExpandListener() { @Override//from w w w.j a v a 2 s . c om public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException { TreePath path = event.getPath(); if (path.getLastPathComponent() instanceof MyTreeNode) { MyTreeNode node = (MyTreeNode) path.getLastPathComponent(); node.LoadChildren((DefaultTreeModel) tree_.getModel()); } } @Override public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException { } }); tree_.addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent e) { TreePath path = e.getNewLeadSelectionPath(); if (path != null) { MyTreeNode node = (MyTreeNode) path.getLastPathComponent(); if (node.UpdatePreview(preview_)) { selectedType_ = node.GetResourceType(); selectedUuid_ = node.GetUuid(); selectedConnection_ = node.GetConnection(); okButton_.setEnabled(true); } removeServer_.setEnabled(node.GetResourceType() == ResourceType.SERVER); } } }); tree_.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { TreePath path = tree_.getPathForLocation(e.getX(), e.getY()); if (path != null) { MyTreeNode node = (MyTreeNode) path.getLastPathComponent(); if (e.getClickCount() == 2 && node.GetResourceType() == ResourceType.INSTANCE) { // Double click on an instance, close the dialog isSuccess_ = true; setVisible(false); } } } }); final JPanel contentPanel = new JPanel(); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new BorderLayout(0, 0)); { JSplitPane splitPane = new JSplitPane(); splitPane.setResizeWeight(0.6); contentPanel.add(splitPane); splitPane.setLeftComponent(new JScrollPane(tree_)); splitPane.setRightComponent(preview_); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton btnAddServer = new JButton("Add server"); btnAddServer.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg) { OrthancConfigurationDialog dd = new OrthancConfigurationDialog(); dd.setLocationRelativeTo(null); // Center dialog on screen OrthancConnection orthanc = dd.ShowModal(); if (orthanc != null) { AddOrthancServer(orthanc); ((DefaultTreeModel) tree_.getModel()).reload(); } } }); buttonPane.add(btnAddServer); } { buttonPane.add(removeServer_); removeServer_.setEnabled(false); removeServer_.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg) { MyTreeNode selected = (MyTreeNode) tree_.getLastSelectedPathComponent(); if (selected.GetResourceType() == ResourceType.SERVER && JOptionPane.showConfirmDialog(null, "Remove server \"" + selected.getUserObject() + "\"?", "WARNING", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { ((DefaultTreeModel) tree_.getModel()).removeNodeFromParent(selected); } } }); } { okButton_.setEnabled(false); okButton_.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg) { isSuccess_ = true; setVisible(false); } }); buttonPane.add(okButton_); getRootPane().setDefaultButton(okButton_); } { JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg) { setVisible(false); } }); buttonPane.add(cancelButton); } } setUndecorated(false); setSize(500, 500); setTitle("Select some series or some instance in Orthanc"); setModal(true); }
From source file:gg.pistol.sweeper.gui.component.DecoratedPanel.java
private void addSideImage() { JPanel panel = createVerticalPanel(); panel.add(new JLabel(sideImage)); panel.add(Box.createVerticalGlue()); if (ComponentOrientation.getOrientation(i18n.getLocale()).isLeftToRight()) { panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, border)); add(panel, BorderLayout.WEST); } else {/* ww w . jav a 2 s. c om*/ panel.setBorder(BorderFactory.createEmptyBorder(0, border, 0, 0)); add(panel, BorderLayout.EAST); } }
From source file:it.cnr.icar.eric.client.ui.swing.AdhocQuerySearchPanel.java
private JPanel createParentOfEntryPanels() { JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createTitledBorder(resourceBundle.getString("title.adHocQueryParameters"))); BorderLayout bl = new BorderLayout(); panel.setLayout(bl);//from w w w . j a va 2s. c o m return panel; }
From source file:com.stonelion.zooviewer.ui.JZVNodePanel.java
private JDialog createAddChildDialog() { final JDialog dlg = new JDialog(); dlg.setModal(true);/* ww w .j a va2 s . co m*/ // Content final JPanel content = new JPanel(); content.setLayout(new BorderLayout()); content.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); // child name AlignmentGridPanel pathPanel = new AlignmentGridPanel(); final JTextField childNameText = new JTextField(); final RSyntaxTextArea childDataArea = new RSyntaxTextArea(); final JMenuBar bar = new JMenuBar(); final JMenu menu = new JMenu("Syntax Highlight"); bar.add(menu); setMenuItem(menu, childDataArea, SyntaxConstants.SYNTAX_STYLE_XML); setMenuItem(menu, childDataArea, SyntaxConstants.SYNTAX_STYLE_JAVA); setMenuItem(menu, childDataArea, SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE); pathPanel.addLine(new Component[] { new JLabel("Select:"), bar }); pathPanel.addLine(new Component[] { new JLabel("Name: "), childNameText }); pathPanel.addLine(new Component[] { new JLabel("Data: ") }); content.add(pathPanel, BorderLayout.NORTH); content.add(new RTextScrollPane(childDataArea), BorderLayout.CENTER); childDataArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE); // Buttons. final CButtonPane btnPanel = new CButtonPane(CButtonPane.TAIL); final JButton btnOk = new JButton("Ok"); btnOk.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String name = childNameText.getText(); String data = childDataArea.getText(); if ((name == null || name.isEmpty()) || (data == null || data.isEmpty())) { JOptionPane.showMessageDialog(null, "Name or Data is empty", "Error", JOptionPane.ERROR_MESSAGE); return; } childName = name; childText = data; dlg.setVisible(false); dlg.dispose(); } }); final JButton btnCancel = new JButton("Cancel"); btnCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { childName = ""; childText = ""; dlg.setVisible(false); dlg.dispose(); } }); btnPanel.add(btnCancel); btnPanel.add(btnOk); btnPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); Container con = dlg.getContentPane(); con.setLayout(new BorderLayout()); con.add(content, BorderLayout.CENTER); con.add(btnPanel, BorderLayout.SOUTH); return dlg; }
From source file:cl.almejo.vsim.gui.SimWindow.java
private JPanel getStatusBar() { JPanel statusBar = new JPanel(); statusBar.setBorder(new BevelBorder(BevelBorder.LOWERED)); return statusBar; }
From source file:org.obiba.onyx.jade.instrument.ricelake.RiceLakeWeightInstrumentRunner.java
/** * Build action buttons sub panel// ww w .j a v a 2s . co m */ protected JPanel buildActionButtonSubPanel() { JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(Box.createHorizontalGlue()); panel.add(saveButton); JButton resetButton = new JButton(resourceBundle.getString("Reset")); resetButton.setMnemonic('R'); resetButton.setToolTipText(resourceBundle.getString("ToolTip.Reset_measurement")); panel.add(Box.createRigidArea(new Dimension(10, 0))); panel.add(resetButton); JButton cancelButton = new JButton(resourceBundle.getString("Cancel")); cancelButton.setMnemonic('A'); cancelButton.setToolTipText(resourceBundle.getString("ToolTip.Cancel_measurement")); panel.add(Box.createRigidArea(new Dimension(10, 0))); panel.add(cancelButton); JButton configureButton = new JButton(resourceBundle.getString("Configure")); configureButton.setMnemonic('C'); configureButton.setToolTipText(resourceBundle.getString("ToolTip.Configure")); panel.add(Box.createRigidArea(new Dimension(10, 0))); panel.add(configureButton); // Configure button listener configureButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { configure(); } }); // Reset button listener resetButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { clearData(); } }); // Save button listener. saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { sendOutputToServer(); } }); // Cancel button listener. cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { confirmOnExit(); } }); panel.setAlignmentX(Component.LEFT_ALIGNMENT); return (panel); }
From source file:org.gumtree.vis.awt.time.TimePlotChartEditor.java
private JPanel createCordinatePanel() { JPanel wrap = new JPanel(new BorderLayout()); JPanel coordinate = new JPanel(new GridLayout(2, 1)); coordinate.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); //Horizontal group JPanel horizontal = new JPanel(new BorderLayout()); horizontal.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Time Axis")); JPanel inner = new JPanel(new LCBLayout(6)); inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); ButtonGroup axisControlGroup = new ButtonGroup(); showAllHistory = new JRadioButton("Show all history"); showAllHistory.setActionCommand(SHOW_ALL_HISTORY_COMMAND); showAllHistory.addActionListener(this); inner.add(showAllHistory);//from w w w. j av a2 s . com inner.add(new JLabel()); inner.add(new JLabel()); // showPartHistory = new JRadioButton("Fix time range"); showPartHistory.setActionCommand(FIXED_LENGTH_HISTORY_COMMAND); showPartHistory.addActionListener(this); inner.add(showPartHistory); timeField = new JTextField(5); inner.add(timeField); inner.add(new JLabel("seconds")); axisControlGroup.add(showAllHistory); axisControlGroup.add(showPartHistory); horizontal.add(inner, BorderLayout.NORTH); //Vertical group // JPanel vertical = new JPanel(new BorderLayout()); // vertical.setBorder(BorderFactory.createTitledBorder( // BorderFactory.createEtchedBorder(), "Vertical Axis")); // // inner = new JPanel(new LCBLayout(6)); // inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); // inner.add(new JLabel("Logarithm Y Axis")); // logarithmY = new JCheckBox(); // logarithmY.setActionCommand(LOGARITHM_Y_AXIS_COMMAND); // logarithmY.addActionListener(this); // inner.add(logarithmY); // inner.add(new JLabel()); // // inner.add(new JLabel("Flip Y Axis")); // flipY = new JCheckBox(); // flipY.setActionCommand(FLIP_Y_AXIS_COMMAND); // flipY.addActionListener(this); // inner.add(flipY); // inner.add(new JLabel()); // vertical.add(inner, BorderLayout.NORTH); coordinate.add(horizontal, BorderLayout.NORTH); // coordinate.add(vertical); wrap.setName("Coordinate"); wrap.add(coordinate, BorderLayout.NORTH); return wrap; }
From source file:ch.zhaw.simulation.diagram.charteditor.DefaultPlotEditor.java
/** * Standard constructor - constructs a panel for editing the properties of * the specified plot./*from www . j av a 2 s . co m*/ * <P> * In designing the panel, we need to be aware that subclasses of Plot will * need to implement subclasses of PlotPropertyEditPanel - so we need to * leave one or two 'slots' where the subclasses can extend the user * interface. * * @param plot * the plot, which should be changed. */ public DefaultPlotEditor(Plot plot) { this.plotInsets = plot.getInsets(); this.backgroundPaintSample = new PaintSample(plot.getBackgroundPaint()); this.outlineStrokeSample = new StrokeSample(plot.getOutlineStroke()); this.outlinePaintSample = new PaintSample(plot.getOutlinePaint()); // Disabled because makes no sense for us // if (plot instanceof CategoryPlot) { // this.plotOrientation = ((CategoryPlot) plot).getOrientation(); // } else if (plot instanceof XYPlot) { // this.plotOrientation = ((XYPlot) plot).getOrientation(); // } if (plot instanceof CategoryPlot) { CategoryItemRenderer renderer = ((CategoryPlot) plot).getRenderer(); if (renderer instanceof LineAndShapeRenderer) { LineAndShapeRenderer r = (LineAndShapeRenderer) renderer; this.drawLines = BooleanUtilities.valueOf(r.getBaseLinesVisible()); this.drawShapes = BooleanUtilities.valueOf(r.getBaseShapesVisible()); } } else if (plot instanceof XYPlot) { XYItemRenderer renderer = ((XYPlot) plot).getRenderer(); if (renderer instanceof StandardXYItemRenderer) { StandardXYItemRenderer r = (StandardXYItemRenderer) renderer; this.drawLines = BooleanUtilities.valueOf(r.getPlotLines()); this.drawShapes = BooleanUtilities.valueOf(r.getBaseShapesVisible()); } } setLayout(new BorderLayout()); this.availableStrokeSamples = new StrokeSample[4]; this.availableStrokeSamples[0] = new StrokeSample(null); this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(1.0f)); this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(2.0f)); this.availableStrokeSamples[3] = new StrokeSample(new BasicStroke(3.0f)); // create a panel for the settings... JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), plot.getPlotType() + localizationResources.getString(":"))); JPanel general = new JPanel(new BorderLayout()); general.setBorder(BorderFactory.createTitledBorder(localizationResources.getString("General"))); JPanel interior = new JPanel(new LCBLayout(7)); interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); interior.add(new JLabel(localizationResources.getString("Outline_stroke"))); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (StrokeSample s : this.availableStrokeSamples) { model.addElement(s.getStroke()); } this.cbOutlineStroke = new JComboBox(model); this.cbOutlineStroke.setSelectedItem(this.outlineStrokeSample.getStroke()); this.cbOutlineStroke.setRenderer(new StrokeComboboxRenderer()); interior.add(this.cbOutlineStroke); interior.add(new JLabel()); interior.add(new JLabel(localizationResources.getString("Outline_Paint"))); JButton button = new JButton(localizationResources.getString("Select...")); button.setActionCommand("OutlinePaint"); button.addActionListener(this); interior.add(this.outlinePaintSample); interior.add(button); interior.add(new JLabel(localizationResources.getString("Background_paint"))); button = new JButton(localizationResources.getString("Select...")); button.setActionCommand("BackgroundPaint"); button.addActionListener(this); interior.add(this.backgroundPaintSample); interior.add(button); // Disabled because makes no sense for us // if (this.plotOrientation != null) { // boolean isVertical = // this.plotOrientation.equals(PlotOrientation.VERTICAL); // int index = isVertical ? ORIENTATION_VERTICAL : // ORIENTATION_HORIZONTAL; // interior.add(new // JLabel(localizationResources.getString("Orientation"))); // this.orientationCombo = new JComboBox(orientationNames); // this.orientationCombo.setSelectedIndex(index); // this.orientationCombo.setActionCommand("Orientation"); // this.orientationCombo.addActionListener(this); // interior.add(this.orientationCombo); // interior.add(new JPanel()); // } if (this.drawLines != null) { interior.add(new JLabel(localizationResources.getString("Draw_lines"))); this.drawLinesCheckBox = new JCheckBox(); this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue()); this.drawLinesCheckBox.setActionCommand("DrawLines"); this.drawLinesCheckBox.addActionListener(this); interior.add(new JPanel()); interior.add(this.drawLinesCheckBox); } if (this.drawShapes != null) { interior.add(new JLabel(localizationResources.getString("Draw_shapes"))); this.drawShapesCheckBox = new JCheckBox(); this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue()); this.drawShapesCheckBox.setActionCommand("DrawShapes"); this.drawShapesCheckBox.addActionListener(this); interior.add(new JPanel()); interior.add(this.drawShapesCheckBox); } general.add(interior, BorderLayout.NORTH); JPanel appearance = new JPanel(new BorderLayout()); appearance.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); appearance.add(general, BorderLayout.NORTH); JTabbedPane tabs = new JTabbedPane(); tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); Axis domainAxis = null; if (plot instanceof CategoryPlot) { domainAxis = ((CategoryPlot) plot).getDomainAxis(); } else if (plot instanceof XYPlot) { domainAxis = ((XYPlot) plot).getDomainAxis(); } this.domainAxisPropertyPanel = DefaultAxisEditor.getInstance(domainAxis); if (this.domainAxisPropertyPanel != null) { this.domainAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); tabs.add(localizationResources.getString("Domain_Axis"), this.domainAxisPropertyPanel); } Axis rangeAxis = null; if (plot instanceof CategoryPlot) { rangeAxis = ((CategoryPlot) plot).getRangeAxis(); } else if (plot instanceof XYPlot) { rangeAxis = ((XYPlot) plot).getRangeAxis(); } this.rangeAxisPropertyPanel = DefaultAxisEditor.getInstance(rangeAxis); if (this.rangeAxisPropertyPanel != null) { this.rangeAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); tabs.add(localizationResources.getString("Range_Axis"), this.rangeAxisPropertyPanel); } tabs.add(localizationResources.getString("Appearance"), appearance); panel.add(tabs); add(panel); }
From source file:com.floreantpos.main.SetUpWindow.java
protected void initUI() { getContentPane().setLayout(new BorderLayout()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ JPanel databaseConfigPanel = new JPanel(new MigLayout("fill,hidemode 3", "[150px][fill, grow]", "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ databaseConfigPanel.setBorder(new TitledBorder(Messages.getString("SetUpWindow.3"))); //$NON-NLS-1$ tfServerAddress = new POSTextField(); tfServerPort = new POSTextField(); tfDatabaseName = new POSTextField(); tfUserName = new POSTextField(); tfPassword = new POSPasswordField(); databaseCombo = new JComboBox(Database.values()); String databaseProviderName = AppConfig.getDatabaseProviderName(); if (StringUtils.isNotEmpty(databaseProviderName)) { databaseCombo.setSelectedItem(Database.getByProviderName(databaseProviderName)); }/*from w ww. jav a 2s. co m*/ btnTestConnection = new PosButton("Test"); //$NON-NLS-1$ btnTestConnection.setActionCommand(TEST); btnCreateDb = new PosButton("Create New"); //$NON-NLS-1$ btnCreateDb.setActionCommand(CREATE_DATABASE); btnCreateSampleData = new PosButton("Create sample data"); //$NON-NLS-1$ btnCreateSampleData.setActionCommand(CREATE_SAMPLE_DATA); databaseConfigPanel.add(new JLabel(Messages.getString("DatabaseConfigurationDialog.8"))); //$NON-NLS-1$ databaseConfigPanel.add(databaseCombo, "w 200!,grow, split 4"); //$NON-NLS-1$ databaseConfigPanel.add(btnTestConnection, "w 50!,h 30!"); //$NON-NLS-1$ databaseConfigPanel.add(btnCreateDb, "w 100!,h 30!"); //$NON-NLS-1$ databaseConfigPanel.add(btnCreateSampleData, "h 30!,wrap"); //$NON-NLS-1$ lblServerAddress = new JLabel(Messages.getString("DatabaseConfigurationDialog.10") + ":"); //$NON-NLS-1$ //$NON-NLS-2$ databaseConfigPanel.add(lblServerAddress); databaseConfigPanel.add(tfServerAddress, "grow, split 3"); //$NON-NLS-1$ lblServerPort = new JLabel("Port" + ":"); //$NON-NLS-1$ //$NON-NLS-2$ databaseConfigPanel.add(lblServerPort); tfServerPort.setHorizontalAlignment(JTextField.RIGHT); databaseConfigPanel.add(tfServerPort, "w 50!,wrap"); //$NON-NLS-1$ lblDbName = new JLabel(Messages.getString("DatabaseConfigurationDialog.16") + ":"); //$NON-NLS-1$ //$NON-NLS-2$ databaseConfigPanel.add(lblDbName); databaseConfigPanel.add(tfDatabaseName, "grow, wrap"); //$NON-NLS-1$ lblUserName = new JLabel(Messages.getString("DatabaseConfigurationDialog.19") + ":"); //$NON-NLS-1$ //$NON-NLS-2$ databaseConfigPanel.add(lblUserName); databaseConfigPanel.add(tfUserName, "grow, split 3"); //$NON-NLS-1$ lblDbPassword = new JLabel("Password" + ":"); //$NON-NLS-1$ //$NON-NLS-2$ databaseConfigPanel.add(lblDbPassword); databaseConfigPanel.add(tfPassword, "grow, wrap"); //$NON-NLS-1$ btnSave = new PosButton(Messages.getString("DatabaseConfigurationDialog.27").toUpperCase()); //$NON-NLS-1$ btnSave.setActionCommand(SAVE); btnExit = new PosButton(Messages.getString("DatabaseConfigurationDialog.28").toUpperCase()); //$NON-NLS-1$ btnExit.setActionCommand(CANCEL); JPanel buttonPanel = new JPanel(new MigLayout("fillx,right")); //$NON-NLS-1$ buttonPanel.add(btnSave, "h 40!,split 2,right"); //$NON-NLS-1$ buttonPanel.add(btnExit, "h 40!"); //$NON-NLS-1$ JPanel contentPanel = new JPanel(new MigLayout("fillx")); //$NON-NLS-1$ contentPanel.add(databaseConfigPanel, "grow,wrap"); //$NON-NLS-1$ //contentPanel.add(createUserPanel(), "grow,wrap"); contentPanel.add(createTerminalConfigPanel(), "grow,wrap"); //$NON-NLS-1$ getContentPane().add(new JideScrollPane(contentPanel), BorderLayout.CENTER); //$NON-NLS-1$ getContentPane().add(buttonPanel, BorderLayout.SOUTH); //$NON-NLS-1$ getContentPane().setBackground(databaseConfigPanel.getBackground()); }
From source file:com.floreantpos.main.SetUpWindow.java
private JPanel createUserPanel() { JPanel userPanel = new JPanel(new MigLayout("fill,hidemode 3", "[150px][fill, grow]", "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ userPanel.setVisible(false);//from w w w . jav a 2 s .c om userPanel.setBorder(new TitledBorder(Messages.getString("SetUpWindow.16"))); //$NON-NLS-1$ lblId = new JLabel(); lblFirstName = new JLabel(); lblLastName = new JLabel(); lblSecretKey = new JLabel(); lblConfirmSecretKey = new JLabel(); tfPassword1 = new JPasswordField(new FixedLengthDocument(16), "", 5); //$NON-NLS-1$ tfPassword2 = new JPasswordField(new FixedLengthDocument(16), "", 5); //$NON-NLS-1$ tfUserId = new FixedLengthTextField(); tfFirstName = new FixedLengthTextField(); tfFirstName.setColumns(20); tfFirstName.setLength(30); tfLastName = new FixedLengthTextField(); tfLastName.setLength(30); tfLastName.setColumns(20); lblId.setText("ID"); //$NON-NLS-1$ userPanel.add(lblId, "aligny center"); //$NON-NLS-1$ userPanel.add(tfUserId, "growx,aligny center,wrap"); //$NON-NLS-1$ lblFirstName.setText("First Name"); //$NON-NLS-1$ userPanel.add(lblFirstName, "aligny center"); //$NON-NLS-1$ userPanel.add(tfFirstName, "growx,aligny center,split 3"); //$NON-NLS-1$ lblLastName.setText("Last Name"); //$NON-NLS-1$ userPanel.add(lblLastName, "aligny center"); //$NON-NLS-1$ userPanel.add(tfLastName, "growx,aligny ,w 200!,center,wrap"); //$NON-NLS-1$ lblSecretKey.setText("Secret Key"); //$NON-NLS-1$ userPanel.add(lblSecretKey, "aligny center"); //$NON-NLS-1$ userPanel.add(tfPassword1, "growx,aligny center,split 3"); //$NON-NLS-1$ lblConfirmSecretKey.setText("Confirm Secret Key"); //$NON-NLS-1$ userPanel.add(lblConfirmSecretKey, "aligny center"); //$NON-NLS-1$ userPanel.add(tfPassword2, "growx,w 200!,aligny center"); //$NON-NLS-1$ return userPanel; }