/** Erstellt die Oberfläche. */ private void jbInit() { m_panel = new JParameterPanel(m_name + ":", "ComboBox", m_selectables, 100, 20, 100, 20); m_panel.setSize(new Dimension(200, 20)); m_okButton = new JButton("OK"); m_okButton.setBorder(BorderFactory.createRaisedBevelBorder()); m_okButton.setActionCommand("OK"); m_okButton.setText(" OK "); m_okButton.setSize(new Dimension(100, 30)); m_okButton.addActionListener(new JSelectionDialog_m_okButton_actionAdapter(this)); GridLayout gridLayout = new GridLayout(1, 3, 10, 10); JPanel panel = new JPanel(); JPanel leftPanel = new JPanel(); JPanel rightPanel = new JPanel(); JPanel buttonPanel = new JPanel(); buttonPanel.setMaximumSize(new Dimension(100, 30)); buttonPanel.setMinimumSize(new Dimension(100, 30)); buttonPanel.setPreferredSize(new Dimension(100, 30)); buttonPanel.add(m_okButton); leftPanel.setMaximumSize(new Dimension(50, 30)); leftPanel.setMinimumSize(new Dimension(50, 30)); leftPanel.setPreferredSize(new Dimension(50, 30)); rightPanel.setMinimumSize(new Dimension(50, 30)); rightPanel.setMaximumSize(new Dimension(50, 30)); rightPanel.setPreferredSize(new Dimension(50, 30)); panel.setLayout(gridLayout); panel.add(leftPanel); panel.add(buttonPanel); panel.add(rightPanel); BorderLayout layout = new BorderLayout(); this.getContentPane().setLayout(layout); this.getContentPane().add(m_panel, BorderLayout.NORTH); this.getContentPane().add(panel, BorderLayout.SOUTH); Dimension ownDimension = new Dimension(200, 90); this.setSize(ownDimension); this.setBounds(650, 500, ownDimension.width, ownDimension.height); }
/** * Eventhandling für den OK-Button. * * @param e */ public void m_okButton_actionPerformed(ActionEvent e) { m_selected = m_panel.getParameterValue(); this.dispose(); }