private void geometry() { // JComponent : Instanciation buttonStart = new JButton("Start"); buttonStop = new JButton("Stop"); buttonNext = new JButton("Suivant"); buttonPrevious = new JButton("Précédent"); // boutonStart.setSize(100, 40); // boutonStop.setSize(100, 40); // boutonStart.setLocation(10, 100); // boutonStop.setLocation(10, 300); buttonStart.setEnabled(true); buttonStop.setEnabled(false); buttonNext.setEnabled(true); buttonPrevious.setEnabled(true); // Layout : Specification { FlowLayout flowlayout = new FlowLayout(FlowLayout.CENTER); setLayout(flowlayout); flowlayout.setHgap(20); // flowlayout.setVgap(20); } // JComponent : add add(buttonStart); add(buttonStop); add(buttonNext); add(buttonPrevious); }
/** @param model */ private void build(CalendarModel model) { this._support = new CalendarSupport(model, new ModelListener()); FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT); flowLayout.setHgap(3); flowLayout.setVgap(0); JPanel p = this._fieldPanel; JTextField hf = this._hourField; JTextField mf = this._minuteField; JTextField sf = this._secondField; p.setLayout(flowLayout); p.add(hf); p.add(this._hmSeparator); p.add(mf); p.add(this._msSeparator); p.add(sf); hf.setHorizontalAlignment(RIGHT); mf.setHorizontalAlignment(RIGHT); sf.setHorizontalAlignment(RIGHT); hf.setDocument(IntegerRangeLimitedDocument.decorate(hf.getDocument(), 0, 23)); mf.setDocument(IntegerRangeLimitedDocument.decorate(mf.getDocument(), 0, 59)); sf.setDocument(IntegerRangeLimitedDocument.decorate(sf.getDocument(), 0, 59)); setLayout(new BorderLayout()); this.add(p, BorderLayout.CENTER); updateUI(); this._changedUI = true; }
public TasksPanelBase() { setLayout(new BorderLayout(0, 0)); panel = new JPanel(); panel.setBorder( new TitledBorder(null, "Tasks", TitledBorder.LEADING, TitledBorder.TOP, null, null)); add(panel, BorderLayout.CENTER); panel.setOpaque(false); panel.setLayout(new BorderLayout(0, 0)); scrollPane = new JScrollPane(); scrollPane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panel.add(scrollPane, BorderLayout.CENTER); taskList = new JList(); taskList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); taskList.setCellRenderer(new TaskListRenderer()); scrollPane.setViewportView(taskList); buttonPanel = new JPanel(); FlowLayout flowLayout = (FlowLayout) buttonPanel.getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); flowLayout.setAlignment(FlowLayout.RIGHT); panel.add(buttonPanel, BorderLayout.SOUTH); deleteButton = new JButton(""); deleteButton.setActionCommand("delete"); deleteButton.setIcon( new ImageIcon(TasksPanelBase.class.getResource("/resources/icons/delete.png"))); buttonPanel.add(deleteButton); }
/** * Builds reading lists tab. * * @return component. */ protected JComponent buildReadingListsTab() { // Wording JComponent wording = msg(Strings.message("guide.dialog.readinglists.wording")); // Buttons Dimension btnSize = new Dimension(20, 20); btnAddReadingList.setPreferredSize(btnSize); btnRemoveList.setPreferredSize(btnSize); FlowLayout layout = new FlowLayout(FlowLayout.LEFT); JPanel bbar = new JPanel(layout); bbar.add(btnAddReadingList); bbar.add(btnRemoveList); layout.setHgap(0); layout.setVgap(0); // Panel BBFormBuilder builder = new BBFormBuilder("0:grow"); builder.setDefaultDialogBorder(); builder.append(wording); builder.appendUnrelatedComponentsGapRow(2); builder.appendRow("min:grow"); builder.append(new JScrollPane(tblReadingLists), 1, CellConstraints.FILL, CellConstraints.FILL); builder.append(bbar); return builder.getPanel(); }
public VolPanel(Dimension d, DetailVolPanel detailPanel) { super(); this.detailPanel = detailPanel; this.bleuStyle = new Color(7, 174, 240); this.d = d; this.setPreferredSize(d); this.setBackground(bleuStyle); this.searchPanel = new JPanel(); searchPanel.setLayout(new BorderLayout()); this.searchPanel.setBackground(bleuStyle); searchField = new JTextField(); searchField.setPreferredSize(new Dimension(400, 10)); searchButton = new JButton("Rechercher"); searchButton.setBackground(Color.WHITE); searchButton.setForeground(bleuStyle); searchButton.addActionListener(this); searchLabel = new JLabel("Rechercher un vol : "); listVolInit(); searchPanel.setPreferredSize(new Dimension(d.width, 50)); searchPanel.setBorder(new EmptyBorder(10, 0, 10, 0)); searchPanel.add(searchField, BorderLayout.CENTER); searchPanel.add(searchButton, BorderLayout.EAST); this.add(searchPanel); scrollPane = new JScrollPane(list); scrollPane.setPreferredSize(new Dimension(d.width, 200)); scrollPane.setBorder(BorderFactory.createLineBorder(bleuStyle)); this.add(scrollPane); FlowLayout flay = new FlowLayout(); flay.setHgap(0); flay.setVgap(0); this.setLayout(flay); ajoutInit(); }
/** * This method initializes panelResultados * * @return javax.swing.JPanel */ JPanel getPanelResultados() { if (panelResultados == null) { FlowLayout flowLayout = new FlowLayout(); flowLayout.setAlignment(java.awt.FlowLayout.LEFT); flowLayout.setVgap(10); flowLayout.setHgap(10); panelResultados = new JPanel(); panelResultados.setLayout(flowLayout); } return panelResultados; }
protected PanelCity() { FlowLayout main = new FlowLayout(); main.setHgap(0); main.setVgap(0); setLayout(main); setPreferredSize( new Dimension( City.SIZE * City.ESTATE_SIZE + BORDER_MARGIN, City.SIZE * City.ESTATE_SIZE + BORDER_MARGIN)); setBackground(Color.BLACK); }
/** * Constructs a toolbar with the given name. * * <p>The name is used when reading/writing XML configuration. It must not be null if you use this * feature. */ public WtoolBar(String barName, TYPE type) { FlowLayout flowLayout = (FlowLayout) getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); flowLayout.setAlignment(FlowLayout.LEADING); this.barName = barName; this.type = type; this.setAlignmentX(LEFT_ALIGNMENT); this.setAlignmentY(TOP_ALIGNMENT); setOpaque(false); addSeparator(SEPARATOR_2x24); }
private void initTopPanel() { _topPanel = new JPanel(); FlowLayout fl__topPanel = (FlowLayout) _topPanel.getLayout(); fl__topPanel.setHgap(0); fl__topPanel.setVgap(0); fl__topPanel.setAlignment(FlowLayout.LEFT); add(_topPanel, BorderLayout.NORTH); _lblRunParamaters = new JLabel("Neural Network Training - Run Parameters"); _lblRunParamaters.setVerticalAlignment(SwingConstants.TOP); _topPanel.add(_lblRunParamaters); }
/** * This method initializes resultProgressPanel4 * * @return javax.swing.JPanel */ private JPanel getResultProgressPanel4() { if (resultProgressPanel4 == null) { FlowLayout flowLayout = new FlowLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setHgap(0); resultProgressPanel4 = new JPanel(); resultProgressPanel4.setLayout(flowLayout); resultProgressPanel4.setName("resultInProgressPanel4"); resultProgressPanel4.setBackground(WINDOW_BACKGROUND_COLOR); resultProgressPanel4.add(getResultProgressBar4(), null); } return resultProgressPanel4; }
/** * This method initializes panelStatus * * @return javax.swing.JPanel */ private JPanel getPanelStatus() { if (panelStatus == null) { FlowLayout flowLayout1 = new FlowLayout(); flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); flowLayout1.setVgap(0); flowLayout1.setHgap(0); panelStatus = new JPanel(); panelStatus.setLayout(flowLayout1); panelStatus.setPreferredSize(new Dimension(5, 25)); panelStatus.add(getPanelServidorStatus(), null); } return panelStatus; }
private void initBottomPanel() { _bottomPanel = new JPanel(); FlowLayout flowLayout = (FlowLayout) _bottomPanel.getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); flowLayout.setAlignment(FlowLayout.LEFT); add(_bottomPanel, BorderLayout.SOUTH); _lblDefSSE = new JLabel("SSE* = Sum of Squared Error"); _lblDefSSE.setHorizontalAlignment(SwingConstants.LEFT); _lblDefSSE.setVerticalAlignment(SwingConstants.TOP); _bottomPanel.add(_lblDefSSE); }
/* WARNING: THIS METHOD WILL BE REGENERATED. */ private java.awt.FlowLayout getJPanel1FlowLayout() { java.awt.FlowLayout ivjJPanel1FlowLayout = null; try { /* Create part */ ivjJPanel1FlowLayout = new java.awt.FlowLayout(); ivjJPanel1FlowLayout.setVgap(10); ivjJPanel1FlowLayout.setHgap(60); } catch (Throwable ivjExc) { handleException(ivjExc); } ; return ivjJPanel1FlowLayout; }
/** * Descripción de Método * * @throws Exception */ private void jbInit() throws Exception { this.setLayout(mainLayout); this.add(splitPane, BorderLayout.CENTER); splitPane.setOpaque(false); graphPanel.setLayout(graphLayout); // splitPane.add(graphPanel, JSplitPane.LEFT); splitPane.add(cardPanel, JSplitPane.RIGHT); splitPane.setBorder(null); splitPane.setName("gc_splitPane"); // cardPanel.setLayout(cardLayout); cardPanel.add(srPane, "srPane"); // Sequence Important! cardPanel.add(mrPane, "mrPane"); cardPanel.setBorder(null); cardPanel.setName("gc_cardPanel"); // single row (w/o xPane it would be centered) srPane.setBorder(null); srPane.setName("gc_srPane"); srPane.setOrientation(JSplitPane.VERTICAL_SPLIT); srPane.add(vPane, JSplitPane.TOP); srPane.setTopComponent(vPane); vPane.getViewport().add(xPanel, null); xPanel.add(vPanel); vPane.setBorder(null); xPanel.setLayout(xLayout); xPanel.setName("gc_xPanel"); xLayout.setAlignment(FlowLayout.LEFT); xLayout.setHgap(0); xLayout.setVgap(0); // multi-row mrPane.setBorder(null); mrPane.getViewport().add(vTable, null); mrPane.setName("gc_mrPane"); // graphPanel.setBorder(null); graphPanel.setName("gc_graphPanel"); srPane.setDividerLocation(200); } // jbInit
protected void setupGui() { setModal(true); setTitle(title); setIconImage(Builder.getApplicationIcon()); mainPanel = new JPanel(); mainPanel.setBackground(Color.WHITE); mainPanel.setBorder(new EmptyBorder(10, 10, 10, 10)); getContentPane().add(mainPanel, BorderLayout.CENTER); mainPanel.setLayout( new MigLayout("", "[597.00,grow,fill]", "[][70px:n,fill][40.00px,grow,fill]")); lblTitle = new JLabel("New label"); mainPanel.add(lblTitle, "cell 0 0,growx,aligny top"); lblTitle.setFont(new Font("Dialog", Font.BOLD, 17)); txtInstructions = new JTextArea(); txtInstructions.setBackground(null); txtInstructions.setFont(new Font("Dialog", Font.PLAIN, 12)); txtInstructions.setEditable(false); txtInstructions.setWrapStyleWord(true); txtInstructions.setLineWrap(true); txtInstructions.setBorder(new EmptyBorder(5, 5, 5, 5)); mainPanel.add(txtInstructions, "cell 0 1,growx,wmin 10"); pagePanel = new JPanel(); pagePanel.setBorder(new EmptyBorder(5, 5, 0, 5)); pagePanel.setBackground(Color.WHITE); mainPanel.add(pagePanel, "cell 0 2,growx,aligny top"); pagePanel.setLayout(new BorderLayout(5, 5)); JPanel buttonPanel = new JPanel(); getContentPane().add(buttonPanel, BorderLayout.SOUTH); btnPrevious = new JButton("< Back"); btnPrevious.setActionCommand("previous"); btnPrevious.addActionListener(this); buttonPanel.setLayout( new MigLayout( "", "[grow][90px:90px:90px,fill][66px,fill][17.00][90px:90px:90px]", "[25px]")); buttonPanel.add(btnPrevious, "cell 1 0,alignx left,aligny top"); btnNext = new JButton("Next >"); btnNext.setActionCommand("next"); btnNext.addActionListener(this); buttonPanel.add(btnNext, "cell 2 0,alignx left,aligny top"); btnClose = new JButton("Cancel"); btnClose.setActionCommand("close"); btnClose.addActionListener(this); buttonPanel.add(btnClose, "cell 4 0,growx,aligny top"); JPanel leftPanel = new JPanel(); FlowLayout flowLayout = (FlowLayout) leftPanel.getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); leftPanel.setBorder(new EmptyBorder(0, 0, 0, 0)); leftPanel.setBackground(new Color(59, 118, 163)); getContentPane().add(leftPanel, BorderLayout.WEST); lblSideImage = new JLabel(""); lblSideImage.setIcon(sideImage); leftPanel.add(lblSideImage); addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { cleanup(); } }); autoEnableNavButtons(); this.setSize(new Dimension(771, 542)); this.setLocationRelativeTo(parent); showPage(0, Direction.FORWARD); }
public SalesmanModiAndDelIFrame() { super(); setIconifiable(true); setClosable(true); setTitle("销售人员信息修改与删除"); setBounds(100, 100, 600, 420); final JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.setPreferredSize(new Dimension(400, 80)); getContentPane().add(panel, BorderLayout.NORTH); final JLabel logoLabel = new JLabel(); ImageIcon readerModiAndDelIcon = CreatecdIcon.add("readerModiAndDel.jpg"); logoLabel.setIcon(readerModiAndDelIcon); logoLabel.setBackground(Color.CYAN); logoLabel.setOpaque(true); logoLabel.setPreferredSize(new Dimension(400, 80)); panel.add(logoLabel); logoLabel.setText("销售人员信息修改logo(400*80)"); final JPanel panel_1 = new JPanel(); panel_1.setLayout(new BorderLayout()); getContentPane().add(panel_1); final JScrollPane scrollPane = new JScrollPane(); scrollPane.setPreferredSize(new Dimension(0, 100)); panel_1.add(scrollPane, BorderLayout.NORTH); final DefaultTableModel model = new DefaultTableModel(); Object[][] results = getFileStates(Dao.selectSalesman()); model.setDataVector(results, columnNames); table = new JTable(); table.setModel(model); scrollPane.setViewportView(table); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.addMouseListener(new TableListener()); final JPanel panel_2 = new JPanel(); final GridLayout gridLayout = new GridLayout(0, 4); gridLayout.setVgap(9); panel_2.setLayout(gridLayout); panel_2.setPreferredSize(new Dimension(0, 200)); panel_1.add(panel_2, BorderLayout.SOUTH); final JLabel label_1 = new JLabel(); label_1.setText(" 姓 名:"); panel_2.add(label_1); readername = new JTextField(); readername.setDocument(new MyDocument(10)); panel_2.add(readername); final JLabel label_2 = new JLabel(); label_2.setText(" 性 别:"); panel_2.add(label_2); final JPanel panel_3 = new JPanel(); final FlowLayout flowLayout_1 = new FlowLayout(); flowLayout_1.setVgap(0); panel_3.setLayout(flowLayout_1); panel_2.add(panel_3); JRadioButton1 = new JRadioButton(); JRadioButton1.setSelected(true); buttonGroup.add(JRadioButton1); panel_3.add(JRadioButton1); JRadioButton1.setText("男"); JRadioButton2 = new JRadioButton(); buttonGroup.add(JRadioButton2); panel_3.add(JRadioButton2); JRadioButton2.setText("女"); final JLabel label_3 = new JLabel(); label_3.setText(" 年 龄:"); panel_2.add(label_3); age = new JTextField(); age.setDocument(new MyDocument(2)); age.addKeyListener(new NumberListener()); panel_2.add(age); final JLabel label_5 = new JLabel(); label_5.setText(" 专 业:"); panel_2.add(label_5); zy = new JTextField(); zy.setDocument(new MyDocument(30)); panel_2.add(zy); final JLabel label = new JLabel(); label.setText(" 有效证件:"); panel_2.add(label); comboBox = new JComboBox(); comboBox.setModel(new DefaultComboBoxModel(array)); for (int i = 1; i < array.length; i++) { comboBox.setSelectedIndex(i); comboBox.setSelectedItem(array); } panel_2.add(comboBox); final JLabel label_6 = new JLabel(); label_6.setText(" 证件号码:"); panel_2.add(label_6); zjnumber = new JTextField(); zjnumber.setDocument(new MyDocument(13)); zjnumber.addKeyListener(new NumberListener()); panel_2.add(zjnumber); final JLabel label_7 = new JLabel(); label_7.setText(" 办证日期:"); panel_2.add(label_7); SimpleDateFormat myfmt = new SimpleDateFormat("yyyy-MM-dd"); bztime = new JFormattedTextField(myfmt.getDateInstance()); panel_2.add(bztime); final JLabel label_9 = new JLabel(); label_9.setText(" 最大调货量:"); panel_2.add(label_9); maxnumber = new JTextField(); maxnumber.addKeyListener(new NumberListener()); panel_2.add(maxnumber); final JLabel label_13 = new JLabel(); label_13.setText(" 证件有效日期:"); panel_2.add(label_13); date = new JFormattedTextField(myfmt.getDateInstance()); panel_2.add(date); final JLabel label_8 = new JLabel(); label_8.setText(" 电 话:"); panel_2.add(label_8); tel = new JFormattedTextField(); tel.addKeyListener(new TelListener()); tel.setDocument(new MyDocument(11)); panel_2.add(tel); final JLabel label_14 = new JLabel(); label_14.setText(" 工 资:"); panel_2.add(label_14); keepmoney = new JTextField(); keepmoney.addKeyListener(new KeepmoneyListener()); panel_2.add(keepmoney); final JLabel label_4 = new JLabel(); label_4.setText(" 销售人员编号:"); panel_2.add(label_4); ISBN = new JTextField(); ISBN.setEditable(false); ISBN.setDocument(new MyDocument(13)); panel_2.add(ISBN); final JPanel panel_4 = new JPanel(); panel_4.setMaximumSize(new Dimension(0, 0)); final FlowLayout flowLayout = new FlowLayout(); flowLayout.setVgap(0); flowLayout.setHgap(4); panel_4.setLayout(flowLayout); panel_2.add(panel_4); final JButton button = new JButton(); button.setHorizontalTextPosition(SwingConstants.CENTER); panel_4.add(button); button.setText("修改"); button.addActionListener(new ModiButtonListener(model)); final JButton buttonDel = new JButton(); panel_4.add(buttonDel); buttonDel.setText("删除"); buttonDel.addActionListener(new DelButtonListener(model)); setVisible(true); // }
private void jbInit() throws Exception { this.setWidth(700); this.setHeight(450); this.setDeviceType("ST133"); this.setDeviceProvider("150.178.3.33"); this.setDeviceTitle("ST133 CCD Controller"); this.getContentPane().setLayout(borderLayout1); jPanel1.setLayout(gridLayout1); gridLayout1.setColumns(1); gridLayout1.setRows(4); jPanel2.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); flowLayout1.setHgap(5); flowLayout1.setVgap(0); flowLayout2.setVgap(0); flowLayout2.setHgap(5); flowLayout2.setAlignment(FlowLayout.LEFT); jPanel3.setLayout(flowLayout2); flowLayout3.setVgap(0); flowLayout3.setHgap(5); flowLayout3.setAlignment(FlowLayout.LEFT); jPanel4.setLayout(flowLayout3); flowLayout4.setVgap(0); flowLayout4.setHgap(5); flowLayout4.setAlignment(FlowLayout.LEFT); jPanel5.setLayout(flowLayout4); deviceField1.setOffsetNid(1); deviceField1.setLabelString("Comment: "); deviceField1.setNumCols(30); deviceField1.setIdentifier(""); deviceField2.setOffsetNid(2); deviceField2.setTextOnly(true); deviceField2.setLabelString("Ip Address: "); deviceField2.setIdentifier(""); deviceChoice1.setChoiceIntValues(null); deviceChoice1.setChoiceFloatValues(null); deviceChoice1.setOffsetNid(3); deviceChoice1.setLabelString("Clock Mode: "); deviceChoice1.setChoiceItems(new String[] {"INTERNAL", "EXTERNAL"}); deviceChoice1.setUpdateIdentifier(""); deviceChoice1.setIdentifier(""); deviceField3.setOffsetNid(4); deviceField3.setLabelString("Clock. Source: "); deviceField3.setNumCols(30); deviceField3.setIdentifier(""); deviceField4.setOffsetNid(14); deviceField4.setLabelString("Exp. Time: "); deviceField4.setNumCols(15); deviceField4.setIdentifier(""); deviceField5.setOffsetNid(18); deviceField5.setLabelString("Num. Frames:"); deviceField5.setIdentifier(""); deviceButtons1.setMethods(new String[] {"init", "store"}); deviceField6.setOffsetNid(16); deviceField6.setLabelString("Cleans: "); deviceField6.setIdentifier(""); deviceField7.setOffsetNid(17); deviceField7.setLabelString("Skip Cleans: "); deviceField7.setIdentifier(""); deviceField8.setOffsetNid(19); deviceField8.setLabelString("Num. ROI"); deviceField8.setIdentifier(""); deviceTable1.setOffsetNid(20); deviceTable1.setNumCols(6); deviceTable1.setNumRows(10); deviceTable1.setIdentifier(""); deviceTable1.setColumnNames( new String[] {"StartX", "EndX", "GroupX", "StartY", "EndY", "GroupY"}); deviceTable1.setRowNames(null); deviceTable1.setDisplayRowNumber(true); this.getContentPane().add(deviceButtons1, BorderLayout.SOUTH); this.getContentPane().add(jPanel1, BorderLayout.NORTH); jPanel1.add(jPanel2, null); jPanel2.add(deviceField1, null); jPanel2.add(deviceField2, null); jPanel1.add(jPanel3, null); jPanel3.add(deviceChoice1, null); jPanel3.add(deviceField3, null); jPanel1.add(jPanel4, null); jPanel4.add(deviceField5, null); jPanel4.add(deviceField4, null); jPanel4.add(deviceDispatch1, null); jPanel1.add(jPanel5, null); jPanel5.add(deviceField6, null); jPanel5.add(deviceField7, null); jPanel5.add(deviceField8, null); this.getContentPane().add(deviceTable1, BorderLayout.CENTER); }
private void initCenterRightPanel() { _centerRightPanel = new JPanel(); add(_centerRightPanel, BorderLayout.CENTER); GridBagLayout gbl__centerRightPanel = new GridBagLayout(); gbl__centerRightPanel.columnWidths = new int[] {0, 0, 0}; gbl__centerRightPanel.rowHeights = new int[] {0, 0, 0, 0, 0, 0}; gbl__centerRightPanel.columnWeights = new double[] {0.0, 0.0, Double.MIN_VALUE}; gbl__centerRightPanel.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; _centerRightPanel.setLayout(gbl__centerRightPanel); _lblNetName = new JLabel("Network"); _lblNetName.setHorizontalAlignment(SwingConstants.LEFT); GridBagConstraints gbc__lblNetName = new GridBagConstraints(); gbc__lblNetName.fill = GridBagConstraints.VERTICAL; gbc__lblNetName.anchor = GridBagConstraints.WEST; gbc__lblNetName.insets = new Insets(0, 0, 5, 5); gbc__lblNetName.gridx = 0; gbc__lblNetName.gridy = 0; _centerRightPanel.add(_lblNetName, gbc__lblNetName); _txtNetName = new JTextField(); _txtNetName.setText("<name>"); _txtNetName.setColumns(15); GridBagConstraints gbc__txtNetName = new GridBagConstraints(); gbc__txtNetName.insets = new Insets(0, 0, 5, 0); gbc__txtNetName.anchor = GridBagConstraints.NORTHWEST; gbc__txtNetName.gridx = 1; gbc__txtNetName.gridy = 0; _centerRightPanel.add(_txtNetName, gbc__txtNetName); _lblStructure = new JLabel("Structure:"); GridBagConstraints gbc_lblStructure = new GridBagConstraints(); gbc_lblStructure.anchor = GridBagConstraints.WEST; gbc_lblStructure.insets = new Insets(0, 0, 5, 5); gbc_lblStructure.gridx = 0; gbc_lblStructure.gridy = 1; _centerRightPanel.add(_lblStructure, gbc_lblStructure); _lblInputLayer = new JLabel("Input Layer"); GridBagConstraints gbc__lblInputLayer = new GridBagConstraints(); gbc__lblInputLayer.anchor = GridBagConstraints.WEST; gbc__lblInputLayer.insets = new Insets(0, 0, 5, 5); gbc__lblInputLayer.gridx = 0; gbc__lblInputLayer.gridy = 2; _centerRightPanel.add(_lblInputLayer, gbc__lblInputLayer); _txtInputNeurons = new JTextField(); _txtInputNeurons.setText("<#neurons>"); GridBagConstraints gbc__txtInputNeurons = new GridBagConstraints(); gbc__txtInputNeurons.anchor = GridBagConstraints.WEST; gbc__txtInputNeurons.insets = new Insets(0, 0, 5, 0); gbc__txtInputNeurons.gridx = 1; gbc__txtInputNeurons.gridy = 2; _centerRightPanel.add(_txtInputNeurons, gbc__txtInputNeurons); _txtInputNeurons.setColumns(15); _lblMiddleLayers = new JLabel("Middle Layers"); GridBagConstraints gbc__lblMiddleLayers = new GridBagConstraints(); gbc__lblMiddleLayers.anchor = GridBagConstraints.NORTHWEST; gbc__lblMiddleLayers.insets = new Insets(0, 0, 5, 5); gbc__lblMiddleLayers.gridx = 0; gbc__lblMiddleLayers.gridy = 3; _centerRightPanel.add(_lblMiddleLayers, gbc__lblMiddleLayers); // Scroll panel _scrollPanel = new JPanel(); GridBagConstraints gbc__scrollPanel = new GridBagConstraints(); gbc__scrollPanel.fill = GridBagConstraints.HORIZONTAL; gbc__scrollPanel.anchor = GridBagConstraints.NORTH; gbc__scrollPanel.insets = new Insets(0, 0, 5, 0); gbc__scrollPanel.gridx = 1; gbc__scrollPanel.gridy = 3; _centerRightPanel.add(_scrollPanel, gbc__scrollPanel); _scrollPanel.setLayout(new BorderLayout(0, 0)); _scrollCmdBar = new JPanel(); FlowLayout fl__scrollCmdBar = (FlowLayout) _scrollCmdBar.getLayout(); fl__scrollCmdBar.setVgap(2); fl__scrollCmdBar.setHgap(2); _scrollPanel.add(_scrollCmdBar, BorderLayout.SOUTH); _btnAddMiddleLayer = new JButton("+"); _scrollCmdBar.add(_btnAddMiddleLayer); _btnAddMiddleLayer.setVerticalAlignment(SwingConstants.TOP); _btnDeleteMiddleLayer = new JButton("-"); _scrollCmdBar.add(_btnDeleteMiddleLayer); _btnDeleteMiddleLayer.setVerticalAlignment(SwingConstants.TOP); _middleLayers = new JPanel(); _middleLayers.setLayout(new VerticalLayout()); _scrollMiddleLayers = new JScrollPane(_middleLayers); _scrollMiddleLayers.setPreferredSize(new Dimension(100, 120)); _scrollPanel.add(_scrollMiddleLayers, BorderLayout.NORTH); _lblOutputLayer = new JLabel("Output Layer"); GridBagConstraints gbc__lblOutputLayer = new GridBagConstraints(); gbc__lblOutputLayer.anchor = GridBagConstraints.WEST; gbc__lblOutputLayer.insets = new Insets(0, 0, 0, 5); gbc__lblOutputLayer.gridx = 0; gbc__lblOutputLayer.gridy = 4; _centerRightPanel.add(_lblOutputLayer, gbc__lblOutputLayer); _txtOutputNeurons = new JTextField(); _txtOutputNeurons.setText("<#neurons>"); GridBagConstraints gbc__txtOutputNeurons = new GridBagConstraints(); gbc__txtOutputNeurons.anchor = GridBagConstraints.WEST; gbc__txtOutputNeurons.gridx = 1; gbc__txtOutputNeurons.gridy = 4; _centerRightPanel.add(_txtOutputNeurons, gbc__txtOutputNeurons); _txtOutputNeurons.setColumns(15); }
public NavigateBar() { setLayout(new BorderLayout()); homeButton = new JButton(); homeButton.setOpaque(false); homeButton.setContentAreaFilled(false); homeButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { JWebBrowser webBrowser = (JWebBrowser) tabPane.getSelectedComponent(); webBrowser.navigate(home); webBrowser.getNativeComponent().requestFocus(); } }); homeButton.setIcon(new ImageIcon(this.getClass().getResource("/ICON-INF/home.gif"))); backButton = new JButton(); backButton.setOpaque(false); backButton.setContentAreaFilled(false); backButton.setIcon(new ImageIcon(this.getClass().getResource("/ICON-INF/back.gif"))); backButton.setEnabled(false); backButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { JWebBrowser webBrowser = (JWebBrowser) tabPane.getSelectedComponent(); webBrowser.navigateBack(); webBrowser.getNativeComponent().requestFocus(); } }); forwardButton = new JButton(); forwardButton.setOpaque(false); forwardButton.setContentAreaFilled(false); forwardButton.setIcon(new ImageIcon(this.getClass().getResource("/ICON-INF/forward.gif"))); forwardButton.setEnabled(false); forwardButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { JWebBrowser webBrowser = (JWebBrowser) tabPane.getSelectedComponent(); webBrowser.navigateForward(); webBrowser.getNativeComponent().requestFocus(); } }); JPanel navigatePanel = new JPanel(); FlowLayout navigateLayout = new FlowLayout(); navigateLayout.setHgap(0); navigateLayout.setVgap(0); navigatePanel.setLayout(navigateLayout); navigatePanel.add(homeButton); navigatePanel.add(backButton); navigatePanel.add(forwardButton); add(navigatePanel, BorderLayout.WEST); locationField = new JTextField(40); locationField.setOpaque(false); locationField.addKeyListener( new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { locationField.selectAll(); } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { JWebBrowser webBrowser = (JWebBrowser) tabPane.getSelectedComponent(); webBrowser.navigate(locationField.getText()); webBrowser.getNativeComponent().requestFocus(); } } }); locationField.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { JWebBrowser webBrowser = (JWebBrowser) tabPane.getSelectedComponent(); webBrowser.navigate(locationField.getText()); webBrowser.getNativeComponent().requestFocus(); } }); add(locationField, BorderLayout.CENTER); JPanel controllPanel = new JPanel(); FlowLayout controllLayout = new FlowLayout(); controllLayout.setHgap(0); controllLayout.setVgap(0); controllPanel.setLayout(controllLayout); reloadButton = new JButton(); reloadButton.setOpaque(false); reloadButton.setContentAreaFilled(false); reloadButton.setIcon(new ImageIcon(this.getClass().getResource("/ICON-INF/reload.gif"))); reloadButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { JWebBrowser webBrowser = (JWebBrowser) tabPane.getSelectedComponent(); webBrowser.reloadPage(); webBrowser.getNativeComponent().requestFocus(); } }); stopButton = new JButton(); stopButton.setOpaque(false); stopButton.setContentAreaFilled(false); stopButton.setIcon(new ImageIcon(this.getClass().getResource("/ICON-INF/stop.gif"))); stopButton.setEnabled(false); stopButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { JWebBrowser webBrowser = (JWebBrowser) tabPane.getSelectedComponent(); webBrowser.stopLoading(); } }); fullButton = new JButton(); fullButton.setOpaque(false); fullButton.setContentAreaFilled(false); fullButton.setIcon(new ImageIcon(this.getClass().getResource("/ICON-INF/fullscreen.gif"))); fullButton.setEnabled(true); fullButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { ActionListener action = (ActionListener) getThis().getClientProperty("fullscreen.action"); action.actionPerformed(e); } }); fullButton.getClientProperty("full"); controllPanel.add(reloadButton); controllPanel.add(stopButton); controllPanel.add(fullButton); add(controllPanel, BorderLayout.EAST); }
/** * Set layout for control panel. Subclasses override this method to change layout. * * <p>Default layout is FlowLayout. */ protected void setControlPanelLayout() { FlowLayout flow = new FlowLayout(); flow.setHgap(5); setLayout(flow); }
/** Create the dialog */ public Manager_PersonnelDialog(String title, String cardName, final int num) { super(); setModal(true); setTitle(title); setBounds(400, 150, 500, 375); final JPanel inputPanel = new JPanel(); inputPanel.setLayout(new GridBagLayout()); getContentPane().add(inputPanel, BorderLayout.NORTH); final JLabel numLabel = new JLabel(); numLabel.setText("编 号:"); final GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.insets = new Insets(10, 0, 0, 0); inputPanel.add(numLabel, gridBagConstraints); numTextField = new JTextField(); numTextField.setEditable(false); numTextField.setColumns(13); // numTextField.setText((num < 0 ? dao.sPersonnelIdOfMax() + 1 : num) + ""); final GridBagConstraints gridBagConstraints_10 = new GridBagConstraints(); gridBagConstraints_10.insets = new Insets(10, 0, 0, 0); gridBagConstraints_10.anchor = GridBagConstraints.WEST; gridBagConstraints_10.gridy = 0; gridBagConstraints_10.gridx = 1; inputPanel.add(numTextField, gridBagConstraints_10); final JLabel typeLabel = new JLabel(); typeLabel.setText("类 别:"); typeLabel.setName("类 别"); final GridBagConstraints gridBagConstraints_1 = new GridBagConstraints(); gridBagConstraints_1.insets = new Insets(5, 0, 0, 0); gridBagConstraints_1.gridy = 1; gridBagConstraints_1.gridx = 0; inputPanel.add(typeLabel, gridBagConstraints_1); typeComboBox = new JComboBox(); // Vector cardV = dao.sTypeByUsed("card"); // for (int i = 0; i < cardV.size(); i++) { // Vector card = (Vector) cardV.get(i); // typeComboBox.addItem(card.get(2)); // } typeComboBox.setSelectedItem(cardName); final GridBagConstraints gridBagConstraints_17 = new GridBagConstraints(); gridBagConstraints_17.anchor = GridBagConstraints.WEST; gridBagConstraints_17.insets = new Insets(5, 0, 0, 0); gridBagConstraints_17.gridy = 1; gridBagConstraints_17.gridx = 1; inputPanel.add(typeComboBox, gridBagConstraints_17); final JLabel nameLabel = new JLabel(); nameLabel.setText("姓 名:"); final GridBagConstraints gridBagConstraints_2 = new GridBagConstraints(); gridBagConstraints_2.insets = new Insets(5, 0, 0, 0); gridBagConstraints_2.gridy = 2; gridBagConstraints_2.gridx = 0; inputPanel.add(nameLabel, gridBagConstraints_2); nameTextField = new JTextField(); nameTextField.setName("姓名"); nameTextField.setColumns(13); final GridBagConstraints gridBagConstraints_11 = new GridBagConstraints(); gridBagConstraints_11.anchor = GridBagConstraints.WEST; gridBagConstraints_11.insets = new Insets(5, 0, 0, 0); gridBagConstraints_11.gridy = 2; gridBagConstraints_11.gridx = 1; inputPanel.add(nameTextField, gridBagConstraints_11); final JLabel sexLabel = new JLabel(); sexLabel.setText("性 别:"); final GridBagConstraints gridBagConstraints_3 = new GridBagConstraints(); gridBagConstraints_3.insets = new Insets(5, 0, 0, 0); gridBagConstraints_3.gridy = 3; gridBagConstraints_3.gridx = 0; inputPanel.add(sexLabel, gridBagConstraints_3); final JPanel sexPanel = new JPanel(); final FlowLayout flowLayout_1 = new FlowLayout(); flowLayout_1.setVgap(0); flowLayout_1.setHgap(0); sexPanel.setLayout(flowLayout_1); final GridBagConstraints gridBagConstraints_18 = new GridBagConstraints(); gridBagConstraints_18.anchor = GridBagConstraints.WEST; gridBagConstraints_18.insets = new Insets(5, 0, 0, 0); gridBagConstraints_18.gridy = 3; gridBagConstraints_18.gridx = 1; inputPanel.add(sexPanel, gridBagConstraints_18); final JRadioButton manRadioButton = new JRadioButton(); buttonGroup.add(manRadioButton); manRadioButton.setText("男 "); sexPanel.add(manRadioButton); final JRadioButton womanRadioButton = new JRadioButton(); buttonGroup.add(womanRadioButton); womanRadioButton.setText("女"); sexPanel.add(womanRadioButton); final JLabel birthdayLabel = new JLabel(); birthdayLabel.setText("出生日期:"); final GridBagConstraints gridBagConstraints_4 = new GridBagConstraints(); gridBagConstraints_4.insets = new Insets(5, 0, 0, 0); gridBagConstraints_4.gridy = 4; gridBagConstraints_4.gridx = 0; inputPanel.add(birthdayLabel, gridBagConstraints_4); final JPanel birthdayPanel = new JPanel(); final FlowLayout flowLayout = new FlowLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setVgap(0); flowLayout.setHgap(0); birthdayPanel.setLayout(flowLayout); final GridBagConstraints gridBagConstraints_19 = new GridBagConstraints(); gridBagConstraints_19.anchor = GridBagConstraints.WEST; gridBagConstraints_19.insets = new Insets(5, 0, 0, 0); gridBagConstraints_19.gridy = 4; gridBagConstraints_19.gridx = 1; inputPanel.add(birthdayPanel, gridBagConstraints_19); yearComboBox = new JComboBox(); yearComboBox.addItem("请选择"); for (int year = 2009; year >= 1950; year--) { yearComboBox.addItem(year); } birthdayPanel.add(yearComboBox); final JLabel yearLabel = new JLabel(); yearLabel.setText("年"); birthdayPanel.add(yearLabel); monthComboBox = new JComboBox(); monthComboBox.addItem("请选择"); for (int month = 1; month <= 12; month++) { monthComboBox.addItem(month); } birthdayPanel.add(monthComboBox); final JLabel monthLabel = new JLabel(); monthLabel.setText("月"); birthdayPanel.add(monthLabel); dayComboBox = new JComboBox(); dayComboBox.addItem("请选择"); for (int day = 1; day <= 31; day++) { dayComboBox.addItem(day); } birthdayPanel.add(dayComboBox); final JLabel dayLabel = new JLabel(); dayLabel.setText("日"); birthdayPanel.add(dayLabel); final JLabel companyLabel = new JLabel(); companyLabel.setText("公 司:"); final GridBagConstraints gridBagConstraints_5 = new GridBagConstraints(); gridBagConstraints_5.insets = new Insets(5, 0, 0, 0); gridBagConstraints_5.gridy = 5; gridBagConstraints_5.gridx = 0; inputPanel.add(companyLabel, gridBagConstraints_5); companyTextField = new JTextField(); companyTextField.setName("公司"); companyTextField.setColumns(30); final GridBagConstraints gridBagConstraints_12 = new GridBagConstraints(); gridBagConstraints_12.anchor = GridBagConstraints.WEST; gridBagConstraints_12.insets = new Insets(5, 0, 0, 0); gridBagConstraints_12.gridy = 5; gridBagConstraints_12.gridx = 1; inputPanel.add(companyTextField, gridBagConstraints_12); final JLabel deptLabel = new JLabel(); deptLabel.setText("部 门:"); final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints(); gridBagConstraints_6.insets = new Insets(5, 0, 0, 0); gridBagConstraints_6.gridy = 6; gridBagConstraints_6.gridx = 0; inputPanel.add(deptLabel, gridBagConstraints_6); deptTextField = new JTextField(); deptTextField.setName("部门"); deptTextField.setColumns(30); final GridBagConstraints gridBagConstraints_13 = new GridBagConstraints(); gridBagConstraints_13.anchor = GridBagConstraints.WEST; gridBagConstraints_13.insets = new Insets(5, 0, 0, 0); gridBagConstraints_13.gridy = 6; gridBagConstraints_13.gridx = 1; inputPanel.add(deptTextField, gridBagConstraints_13); final JLabel dutyLabel = new JLabel(); dutyLabel.setText("职 务:"); final GridBagConstraints gridBagConstraints_7 = new GridBagConstraints(); gridBagConstraints_7.insets = new Insets(5, 0, 0, 0); gridBagConstraints_7.gridy = 7; gridBagConstraints_7.gridx = 0; inputPanel.add(dutyLabel, gridBagConstraints_7); dutyTextField = new JTextField(); dutyTextField.setName("职务"); dutyTextField.setColumns(30); final GridBagConstraints gridBagConstraints_14 = new GridBagConstraints(); gridBagConstraints_14.anchor = GridBagConstraints.WEST; gridBagConstraints_14.insets = new Insets(5, 0, 0, 0); gridBagConstraints_14.gridy = 7; gridBagConstraints_14.gridx = 1; inputPanel.add(dutyTextField, gridBagConstraints_14); final JLabel handsetLabel = new JLabel(); handsetLabel.setText("移动电话:"); final GridBagConstraints gridBagConstraints_8 = new GridBagConstraints(); gridBagConstraints_8.insets = new Insets(5, 0, 0, 0); gridBagConstraints_8.gridy = 8; gridBagConstraints_8.gridx = 0; inputPanel.add(handsetLabel, gridBagConstraints_8); handsetTextField = new JTextField(); handsetTextField.setName("移动电话"); handsetTextField.setColumns(30); final GridBagConstraints gridBagConstraints_15 = new GridBagConstraints(); gridBagConstraints_15.anchor = GridBagConstraints.WEST; gridBagConstraints_15.insets = new Insets(5, 0, 0, 0); gridBagConstraints_15.gridy = 8; gridBagConstraints_15.gridx = 1; inputPanel.add(handsetTextField, gridBagConstraints_15); final JLabel emailLabel = new JLabel(); emailLabel.setText(" E-mail :"); final GridBagConstraints gridBagConstraints_9 = new GridBagConstraints(); gridBagConstraints_9.insets = new Insets(5, 0, 0, 0); gridBagConstraints_9.gridy = 9; gridBagConstraints_9.gridx = 0; inputPanel.add(emailLabel, gridBagConstraints_9); emailTextField = new JTextField(); emailTextField.setName("E-mail"); emailTextField.setColumns(30); final GridBagConstraints gridBagConstraints_16 = new GridBagConstraints(); gridBagConstraints_16.anchor = GridBagConstraints.WEST; gridBagConstraints_16.insets = new Insets(5, 0, 0, 0); gridBagConstraints_16.gridy = 9; gridBagConstraints_16.gridx = 1; inputPanel.add(emailTextField, gridBagConstraints_16); final JPanel panel_2 = new JPanel(); final FlowLayout flowLayout_2 = new FlowLayout(); flowLayout_2.setAlignment(FlowLayout.RIGHT); flowLayout_2.setVgap(0); panel_2.setLayout(flowLayout_2); final GridBagConstraints gridBagConstraints_20 = new GridBagConstraints(); gridBagConstraints_20.anchor = GridBagConstraints.EAST; gridBagConstraints_20.insets = new Insets(10, 0, 0, 0); gridBagConstraints_20.gridy = 10; gridBagConstraints_20.gridx = 1; inputPanel.add(panel_2, gridBagConstraints_20); final JButton submitButton = new JButton(); submitButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // 通过反射验证文本框 Field[] fields = Manager_PersonnelDialog.class.getDeclaredFields(); for (int i = fields.length - 1; i >= 0; i--) { Field field = fields[i]; if (field.getType().equals(JTextField.class)) { field.setAccessible(true); JTextField textField = null; try { textField = (JTextField) field.get(Manager_PersonnelDialog.this); } catch (Exception e1) { e1.printStackTrace(); } if (textField.getText().equals("")) { JOptionPane.showMessageDialog( null, "请填写“" + textField.getName() + "”!", "友情提示", JOptionPane.INFORMATION_MESSAGE); textField.requestFocus(); return; } } } // 验证性别 if (!manRadioButton.isSelected() && !womanRadioButton.isSelected()) { JOptionPane.showMessageDialog( null, "请填写“性别”!", "友情提示", JOptionPane.INFORMATION_MESSAGE); return; } // 验证出生日期 boolean notSelectedYear = yearComboBox.getSelectedIndex() == 0; boolean notSelectedMonth = monthComboBox.getSelectedIndex() == 0; boolean notSelectedDay = dayComboBox.getSelectedIndex() == 0; if (notSelectedYear || notSelectedMonth || notSelectedDay) { JOptionPane.showMessageDialog( null, "请填写“出生日期”!", "友情提示", JOptionPane.INFORMATION_MESSAGE); return; } // 获取信息 Vector personnelV = new Vector(); personnelV.add(numTextField.getText()); personnelV.add(typeComboBox.getSelectedItem()); personnelV.add(nameTextField.getText()); personnelV.add((manRadioButton.isSelected() ? "男" : "女")); personnelV.add( yearComboBox.getSelectedItem() + "-" + monthComboBox.getSelectedItem() + "-" + dayComboBox.getSelectedItem()); personnelV.add(companyTextField.getText()); personnelV.add(deptTextField.getText()); personnelV.add(dutyTextField.getText()); personnelV.add(handsetTextField.getText()); personnelV.add(emailTextField.getText()); // if (num < 0) // dao.iPersonnel(personnelV); // else // dao.uPersonnel(personnelV); dispose(); } }); submitButton.setText("确定"); panel_2.add(submitButton); final JButton exitButton = new JButton(); exitButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); } }); exitButton.setText("退出"); panel_2.add(exitButton); // if (num > 0) { //// Vector personnelV = dao.sPersonnelVByNum(num); // typeComboBox.setSelectedItem(personnelV.get(1)); //// nameTextField.setText(personnelV.get(2).toString()); //// String sex = personnelV.get(3).toString().trim(); // if (sex.equals("男")) // manRadioButton.setSelected(true); //// else //// womanRadioButton.setSelected(true); //// String birthday = personnelV.get(4).toString(); //// int year = Integer.valueOf(birthday.substring(0, 4)); //// int month = Integer.valueOf(birthday.substring(5, 7)); //// int day = Integer.valueOf(birthday.substring(8, 10)); //// yearComboBox.setSelectedItem(year); //// monthComboBox.setSelectedItem(month); //// dayComboBox.setSelectedItem(day); //// companyTextField.setText(personnelV.get(5).toString()); //// deptTextField.setText(personnelV.get(6).toString()); //// dutyTextField.setText(personnelV.get(7).toString()); //// handsetTextField.setText(personnelV.get(8).toString()); //// emailTextField.setText(personnelV.get(9).toString()); } }
private void jbInit() throws Exception { this.setLayout(new BorderLayout()); this.add(jPanel2, BorderLayout.CENTER); jPanel2.setLayout(gridBagLayout1); jLabelFont.setText(Messages.getString("LabelPrefView.name") + StringUtil.COLON); // $NON-NLS-1$ jLabelSize.setText(Messages.getString("LabelPrefView.size") + StringUtil.COLON); // $NON-NLS-1$ jPanel2.setBorder(new TitledBorder(Messages.getString("LabelPrefView.font"))); // $NON-NLS-1$ jCheckBoxBold.setText(Messages.getString("LabelPrefView.bold")); // $NON-NLS-1$ jCheckBoxItalic.setText(Messages.getString("LabelPrefView.italic")); // $NON-NLS-1$ jPanel2.add( jComboSize, new GridBagConstraints( 1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 2, 5, 5), 0, 0)); jPanel2.add( jLabelFont, new GridBagConstraints( 0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); jPanel2.add( jComboName, new GridBagConstraints( 2, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 2, 5, 0), 0, 0)); jPanel2.add( jCheckBoxItalic, new GridBagConstraints( 4, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0)); jPanel2.add( jCheckBoxBold, new GridBagConstraints( 3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); jPanel2.add( jLabelSize, new GridBagConstraints( 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); GridBagConstraints gbc_verticalStrut = new GridBagConstraints(); gbc_verticalStrut.weighty = 1.0; gbc_verticalStrut.weightx = 1.0; gbc_verticalStrut.gridx = 4; gbc_verticalStrut.gridy = 2; jPanel2.add(verticalStrut, gbc_verticalStrut); JPanel panel_2 = new JPanel(); FlowLayout flowLayout_1 = (FlowLayout) panel_2.getLayout(); flowLayout_1.setHgap(10); flowLayout_1.setAlignment(FlowLayout.RIGHT); flowLayout_1.setVgap(7); add(panel_2, BorderLayout.SOUTH); panel_2.add(jButtonApply); jButtonApply.setText(Messages.getString("LabelPrefView.apply")); // $NON-NLS-1$ jButtonApply.addActionListener( new java.awt.event.ActionListener() { @Override public void actionPerformed(ActionEvent e) { apply(); } }); JButton btnNewButton = new JButton(Messages.getString("restore.values")); // $NON-NLS-1$ panel_2.add(btnNewButton); btnNewButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { resetoDefaultValues(); } }); }
private void initGUI() { try { { GridBagLayout thisLayout = new GridBagLayout(); thisLayout.rowWeights = new double[] {0.0, 0.1}; thisLayout.rowHeights = new int[] {267, 7}; thisLayout.columnWeights = new double[] {0.0, 0.1, 0.1}; thisLayout.columnWidths = new int[] {154, 7, 7}; getContentPane().setLayout(thisLayout); { pnButtons = new JPanel(); FlowLayout pnButtonsLayout = new FlowLayout(); pnButtonsLayout.setAlignment(FlowLayout.LEFT); pnButtons.setLayout(pnButtonsLayout); getContentPane() .add( pnButtons, new GridBagConstraints( 0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); { btOK = new JButton( Messages.getMessage(getLocale(), "$MD11617"), IconRegistry.getIcon("accept.png")); pnButtons.add(btOK); btOK.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { createArc(); drawingPane.getDrawObjectsAsGeoPoints().clear(); digitizerModule.getMapModule().update(); } }); } { btCancel = new JButton( Messages.getMessage(getLocale(), "$MD11618"), IconRegistry.getIcon("cancel.png")); pnButtons.add(btCancel); btCancel.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); } }); } } { pnHelp = new JPanel(); FlowLayout pnHelpLayout = new FlowLayout(); pnHelpLayout.setAlignment(FlowLayout.RIGHT); pnHelp.setLayout(pnHelpLayout); getContentPane() .add( pnHelp, new GridBagConstraints( 2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); { btHelp = new JButton( Messages.getMessage(getLocale(), "$MD11619"), IconRegistry.getIcon("help.png")); pnHelp.add(btHelp); } } { pnDescription = new JPanel(); BorderLayout pnDescriptionLayout = new BorderLayout(); pnDescription.setLayout(pnDescriptionLayout); getContentPane() .add( pnDescription, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pnDescription.setBorder( BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11620"))); { tpDescription = new JTextPane(); pnDescription.add(tpDescription, BorderLayout.CENTER); tpDescription.setBackground(pnDescription.getBackground()); tpDescription.setEditable(false); tpDescription.setContentType("text/html"); tpDescription.setText(Messages.getMessage(getLocale(), "$MD11621")); } } { pnControl = new JPanel(); GridBagLayout pnControlLayout = new GridBagLayout(); getContentPane() .add( pnControl, new GridBagConstraints( 1, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pnControl.setBorder( BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11622"))); pnControlLayout.rowWeights = new double[] {0.0, 0.0, 0.1}; pnControlLayout.rowHeights = new int[] {63, 109, 20}; pnControlLayout.columnWeights = new double[] {0.1}; pnControlLayout.columnWidths = new int[] {7}; pnControl.setLayout(pnControlLayout); { pnArc = new JPanel(); GridBagLayout pnArcLayout = new GridBagLayout(); pnControl.add( pnArc, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pnArc.setBorder( BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11623"))); pnArcLayout.rowWeights = new double[] {0.1}; pnArcLayout.rowHeights = new int[] {7}; pnArcLayout.columnWeights = new double[] {0.1}; pnArcLayout.columnWidths = new int[] {7}; pnArc.setLayout(pnArcLayout); { spArc = new JSpinner(new SpinnerNumberModel(0, -181, 181, 0.5)); pnArc.add( spArc, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 0, 9), 0, 0)); spArc.addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent e) { applyArc(); } }); } } { pnRadius = new JPanel(); GridBagLayout pnRadiusLayout = new GridBagLayout(); pnControl.add( pnRadius, new GridBagConstraints( 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pnRadius.setBorder( BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11624"))); pnRadiusLayout.rowWeights = new double[] {0.0, 0.1}; pnRadiusLayout.rowHeights = new int[] {43, 20}; pnRadiusLayout.columnWeights = new double[] {0.1}; pnRadiusLayout.columnWidths = new int[] {7}; pnRadius.setLayout(pnRadiusLayout); { spArcRadius = new JSpinner(new SpinnerNumberModel(1d, 0.0001, 999999999, 0.5)); pnRadius.add( spArcRadius, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 0, 9), 0, 0)); spArcRadius.addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent e) { applyRadius(); } }); } { pnUOM = new JPanel(); FlowLayout pnUOMLayout = new FlowLayout(); pnUOMLayout.setAlignment(FlowLayout.LEFT); pnUOMLayout.setHgap(9); pnUOMLayout.setVgap(10); pnUOM.setLayout(pnUOMLayout); pnRadius.add( pnUOM, new GridBagConstraints( 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); { lbUOM = new JLabel(Messages.getMessage(getLocale(), "$MD11625")); pnUOM.add(lbUOM); lbUOM.setPreferredSize(new Dimension(102, 16)); } { String tmp = Messages.getMessage(getLocale(), "$MD11626"); cbUOM = new JComboBox(new DefaultComboBoxModel(tmp.split(","))); pnUOM.add(cbUOM); cbUOM.setPreferredSize(new Dimension(136, 22)); } } } { pnRotation = new JPanel(); GridBagLayout pnRotationLayout = new GridBagLayout(); pnControl.add( pnRotation, new GridBagConstraints( 0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 0, 0, 0, 0), 0, 0)); pnRotation.setBorder( BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11627"))); pnRotationLayout.rowWeights = new double[] {0.1}; pnRotationLayout.rowHeights = new int[] {7}; pnRotationLayout.columnWeights = new double[] {0.1}; pnRotationLayout.columnWidths = new int[] {7}; pnRotation.setLayout(pnRotationLayout); { spNoOfVertices = new JSpinner(new SpinnerNumberModel(10, 5, 1000, 1)); pnRotation.add( spNoOfVertices, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 0, 9), 0, 0)); } } } } this.setSize(457, 339); } catch (Exception e) { e.printStackTrace(); } }
private void jbInit() throws Exception { this.setWidth(529); this.setHeight(529); this.setDeviceType("WE900"); this.setDeviceProvider("localhost"); this.setDeviceTitle("YOKOGAWA Rack 9 Slots"); this.getContentPane().setLayout(null); jPanel1.setLayout(null); deviceField1.setOffsetNid(1); deviceField1.setLabelString("Comment: "); deviceField1.setNumCols(25); jPanel3.setLayout(flowLayout2); flowLayout2.setAlignment(FlowLayout.LEFT); flowLayout2.setHgap(0); flowLayout2.setVgap(0); deviceChoice1.setOffsetNid(6); deviceChoice1.setLabelString("Bus Trigger 2:"); deviceChoice1.setChoiceItems(new String[] {"SOFTWARE", "EXT I/O", "TRIGIN"}); jPanel4.setLayout(flowLayout3); flowLayout3.setAlignment(FlowLayout.LEFT); flowLayout3.setHgap(5); flowLayout3.setVgap(0); deviceField2.setOffsetNid(7); deviceField2.setLabelString("Source: "); deviceField2.setNumCols(20); flowLayout4.setAlignment(FlowLayout.LEFT); flowLayout4.setHgap(5); flowLayout4.setVgap(0); jPanel5.setLayout(flowLayout4); deviceChoice2.setOffsetNid(4); deviceChoice2.setLabelString("Bus Trigger 1:"); deviceChoice2.setShowState(false); deviceChoice2.setChoiceItems(new String[] {"SOFTWARE", "EXT I/O", "TRIGIN"}); deviceField5.setOffsetNid(5); deviceField5.setLabelString("Source: "); deviceField5.setNumCols(20); deviceField6.setNumCols(20); deviceField6.setOffsetNid(10); deviceField6.setLabelString("Source: "); deviceChoice3.setChoiceItems(new String[] {"NONE", "EXT I/O", "TRIGIN"}); deviceChoice3.setOffsetNid(9); deviceChoice3.setLabelString("Cmn. Clock:"); flowLayout5.setAlignment(FlowLayout.LEFT); flowLayout5.setHgap(5); flowLayout5.setVgap(0); jPanel6.setLayout(flowLayout5); jPanel1.setPreferredSize(new Dimension(300, 500)); jPanel1.setBounds(new Rectangle(1, 2, 529, 396)); jScrollPane1.setDebugGraphicsOptions(0); jScrollPane1.setBounds(new Rectangle(15, 191, 488, 138)); deviceChoice4.setOffsetNid(8); deviceChoice4.setLabelString("Trigger Slope:"); deviceChoice4.setChoiceItems(new String[] {"POSITIVE", "NEGATIVE"}); flowLayout6.setAlignment(FlowLayout.LEFT); flowLayout6.setVgap(0); jPanel7.setLayout(flowLayout6); flowLayout1.setAlignment(FlowLayout.LEFT); flowLayout1.setHgap(0); flowLayout1.setVgap(0); deviceField3.setNumCols(15); deviceField3.setOffsetNid(2); deviceField3.setLabelString("Controller IP: "); jPanel2.setLayout(flowLayout1); jPanel3.setBounds(new Rectangle(2, 1, 524, 31)); jPanel5.setBounds(new Rectangle(1, 94, 564, 31)); jPanel6.setBounds(new Rectangle(2, 61, 578, 31)); jPanel4.setBounds(new Rectangle(3, 127, 565, 31)); jPanel7.setBounds(new Rectangle(4, 158, 216, 31)); jPanel2.setBounds(new Rectangle(7, 34, 572, 31)); deviceButtons1.setMethods(new String[] {"init", "arm", "turnOff"}); deviceButtons1.setBounds(new Rectangle(24, 347, 474, 35)); jPanel8.setLayout(gridLayout1); gridLayout1.setColumns(1); gridLayout1.setRows(9); deviceField9.setLabelString("Modules Linked"); deviceField9.setNumCols(10); deviceField9.setOffsetNid(32); deviceChoice7.setIdentifier(""); deviceChoice7.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice7.setShowState(false); deviceChoice7.setLabelString("Module Type"); deviceChoice7.setOffsetNid(31); deviceChannel3.setInSameLine(true); deviceChannel3.setLabelString("Slot 07"); deviceChannel3.setOffsetNid(30); jPanel9.setLayout(flowLayout7); flowLayout7.setHgap(0); flowLayout7.setVgap(0); flowLayout8.setVgap(0); flowLayout8.setHgap(0); deviceField10.setOffsetNid(35); deviceField10.setLabelString("Modules Linked"); deviceField10.setIdentifier(""); deviceChoice8.setOffsetNid(34); deviceChoice8.setLabelString("Module Type"); deviceChoice8.setShowState(false); deviceChoice8.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice8.setIdentifier(""); jPanel10.setLayout(flowLayout8); deviceChannel4.setInSameLine(true); deviceChannel4.setLabelString("Slot 08"); deviceChannel4.setOffsetNid(33); flowLayout9.setVgap(0); flowLayout9.setHgap(0); deviceField11.setOffsetNid(29); deviceField11.setLabelString("Modules Linked"); deviceField11.setNumCols(10); deviceChoice9.setOffsetNid(28); deviceChoice9.setLabelString("Module Type"); deviceChoice9.setShowState(false); deviceChoice9.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice9.setIdentifier(""); jPanel14.setLayout(flowLayout9); deviceChannel5.setInSameLine(true); deviceChannel5.setLabelString("Slot 06"); deviceChannel5.setOffsetNid(27); deviceChannel5.setLines(1); flowLayout10.setVgap(0); flowLayout10.setHgap(0); deviceField12.setOffsetNid(14); deviceField12.setLabelString("Modules Linked"); deviceChoice10.setOffsetNid(13); deviceChoice10.setLabelString("Module Type"); deviceChoice10.setShowState(false); deviceChoice10.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice10.setIdentifier(""); jPanel16.setLayout(flowLayout10); deviceChannel6.setInSameLine(true); deviceChannel6.setLabelString("Slot 01"); deviceChannel6.setOffsetNid(12); deviceChannel6.setLines(1); flowLayout11.setVgap(0); flowLayout11.setHgap(0); deviceField13.setOffsetNid(26); deviceField13.setLabelString("Modules Linked"); deviceField13.setIdentifier(""); deviceChoice11.setOffsetNid(25); deviceChoice11.setLabelString("Module Type"); deviceChoice11.setShowState(false); deviceChoice11.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice11.setIdentifier(""); jPanel18.setLayout(flowLayout11); deviceChannel7.setInSameLine(true); deviceChannel7.setLabelString("Slot 05"); deviceChannel7.setOffsetNid(24); deviceChannel7.setLines(1); flowLayout12.setVgap(0); flowLayout12.setHgap(0); deviceField14.setOffsetNid(23); deviceField14.setLabelString("Modules Linked"); deviceField14.setIdentifier(""); deviceChoice12.setOffsetNid(22); deviceChoice12.setLabelString("Module Type"); deviceChoice12.setShowState(false); deviceChoice12.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice12.setIdentifier(""); jPanel110.setLayout(flowLayout12); deviceChannel8.setInSameLine(true); deviceChannel8.setLabelString("Slot 04"); deviceChannel8.setOffsetNid(21); deviceChannel8.setLines(1); flowLayout13.setVgap(0); flowLayout13.setHgap(0); deviceField15.setOffsetNid(20); deviceField15.setLabelString("Modules Linked"); deviceField15.setIdentifier(""); deviceChoice13.setOffsetNid(19); deviceChoice13.setLabelString("Module Type"); deviceChoice13.setShowState(false); deviceChoice13.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice13.setIdentifier(""); jPanel112.setLayout(flowLayout13); deviceChannel9.setInSameLine(true); deviceChannel9.setLabelString("Slot 03"); deviceChannel9.setOffsetNid(18); deviceChannel9.setLines(1); flowLayout14.setVgap(0); flowLayout14.setHgap(0); deviceField16.setOffsetNid(17); deviceField16.setLabelString("Modules Linked"); deviceField16.setNumCols(10); deviceChoice14.setOffsetNid(16); deviceChoice14.setLabelString("Module Type"); deviceChoice14.setShowState(false); deviceChoice14.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice14.setIdentifier(""); jPanel114.setLayout(flowLayout14); deviceChannel10.setInSameLine(true); deviceChannel10.setLabelString("Slot 02"); deviceChannel10.setOffsetNid(15); deviceChannel10.setLines(1); deviceField4.setOffsetNid(3); deviceField4.setLabelString("Station IP:"); deviceField4.setNumCols(15); jPanel115.setLayout(flowLayout15); deviceField17.setOffsetNid(38); deviceField17.setLabelString("Modules Linked"); deviceField17.setIdentifier(""); deviceChannel11.setInSameLine(true); deviceChannel11.setLabelString("Slot 09"); deviceChannel11.setOffsetNid(36); deviceChoice15.setOffsetNid(37); deviceChoice15.setLabelString("Module Type"); deviceChoice15.setShowState(false); deviceChoice15.setChoiceItems(new String[] {"WE7275", "WE7116"}); deviceChoice15.setIdentifier(""); flowLayout15.setVgap(0); flowLayout15.setHgap(0); jPanel3.add(deviceField1, null); jPanel3.add(deviceDispatch1, null); jPanel1.add(deviceButtons1, null); jPanel1.add(jScrollPane1, null); jScrollPane1.getViewport().add(jPanel8, null); jPanel11.add(deviceChoice7, null); jPanel11.add(deviceField9, null); jPanel8.add(jPanel16, null); jPanel16.add(deviceChannel6, null); deviceChannel6.add(jPanel15, BorderLayout.EAST); jPanel15.add(deviceChoice10, null); jPanel15.add(deviceField12, null); jPanel116.add(deviceChoice15, null); jPanel116.add(deviceField17, null); jPanel8.add(jPanel114, null); jPanel114.add(deviceChannel10, null); deviceChannel10.add(jPanel113, BorderLayout.EAST); jPanel113.add(deviceChoice14, null); jPanel113.add(deviceField16, null); jPanel8.add(jPanel112, null); jPanel112.add(deviceChannel9, null); deviceChannel9.add(jPanel111, BorderLayout.EAST); jPanel111.add(deviceChoice13, null); jPanel111.add(deviceField15, null); jPanel8.add(jPanel110, null); jPanel110.add(deviceChannel8, null); deviceChannel8.add(jPanel19, BorderLayout.EAST); jPanel19.add(deviceChoice12, null); jPanel19.add(deviceField14, null); jPanel8.add(jPanel18, null); jPanel18.add(deviceChannel7, null); deviceChannel7.add(jPanel17, BorderLayout.EAST); jPanel17.add(deviceChoice11, null); jPanel17.add(deviceField13, null); jPanel8.add(jPanel14, null); jPanel14.add(deviceChannel5, null); deviceChannel5.add(jPanel13, BorderLayout.EAST); jPanel8.add(jPanel9, null); jPanel9.add(deviceChannel3, null); deviceChannel3.add(jPanel11, BorderLayout.EAST); jPanel13.add(deviceChoice9, null); jPanel13.add(deviceField11, null); jPanel8.add(jPanel10, null); jPanel10.add(deviceChannel4, null); deviceChannel4.add(jPanel12, BorderLayout.EAST); jPanel12.add(deviceChoice8, null); jPanel12.add(deviceField10, null); jPanel8.add(jPanel115, null); jPanel115.add(deviceChannel11, null); deviceChannel11.add(jPanel116, BorderLayout.EAST); jPanel1.add(jPanel7, null); jPanel7.add(deviceChoice4, null); jPanel6.add(deviceChoice3, null); jPanel6.add(deviceField6, null); jPanel1.add(jPanel4, null); jPanel1.add(jPanel5, null); jPanel5.add(deviceChoice2, null); jPanel5.add(deviceField5, null); jPanel4.add(deviceChoice1, null); jPanel4.add(deviceField2, null); jPanel1.add(jPanel6, null); jPanel1.add(jPanel2, null); jPanel2.add(deviceField3, null); jPanel2.add(deviceField4, null); jPanel1.add(jPanel3, null); this.getContentPane().add(jPanel1, null); }
private void initialize() { setTitle(TITLE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 800, 600); this.addWindowListener(this); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); setContentPane(contentPane); tabbedPane = new JTabbedPane(JTabbedPane.TOP); tabbedPane.addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent changeEvent) { setProcessMenuItemsEnabled(); } }); contentPane.add(tabbedPane, BorderLayout.CENTER); JPanel panelSystemBorder = new JPanel(new BorderLayout(0, 0)); tabbedPane.addTab("System", null, panelSystemBorder, null); panelSystem = new PanelSystem(); panelSystemBorder.add(panelSystem, BorderLayout.CENTER); JPanel panelSystemSouth = new JPanel(); FlowLayout flowLayout = (FlowLayout) panelSystemSouth.getLayout(); flowLayout.setHgap(10); flowLayout.setAlignment(FlowLayout.RIGHT); panelSystemBorder.add(panelSystemSouth, BorderLayout.SOUTH); buttonConnect = new JButton("Connect"); buttonConnect.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { if (sshSession.isConnected()) { stop(); sshSession.disconnect(); toggleConnected(); } else { login(); } } catch (Exception e) { e.printStackTrace(); } } }); buttonConnect.setFocusable(false); panelSystemSouth.add(buttonConnect); JPanel panelProcessBorder = new JPanel(new BorderLayout(0, 0)); tabbedPane.addTab("Processes", null, panelProcessBorder, null); panelProcesses = new PanelProcesses(this); panelProcessBorder.add(panelProcesses, BorderLayout.CENTER); JPanel panelProcessSouth = new JPanel(); FlowLayout processFlowLayout = (FlowLayout) panelProcessSouth.getLayout(); processFlowLayout.setHgap(10); processFlowLayout.setAlignment(FlowLayout.RIGHT); panelProcessBorder.add(panelProcessSouth, BorderLayout.SOUTH); buttonEndProcess = new JButton("End Process"); buttonEndProcess.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { try { runKillCommand("-TERM"); } catch (Exception e) { e.printStackTrace(); } } }); buttonEndProcess.setFocusable(false); panelProcessSouth.add(buttonEndProcess); panelResources = new PanelResources(); tabbedPane.addTab("Resources", null, panelResources, null); panelFileSystems = new PanelFileSystems(); tabbedPane.addTab("File Systems", null, panelFileSystems, null); }