1 package net.matuschek.jobo; 2 3 import javax.swing.BoxLayout ; 4 import javax.swing.JButton ; 5 import javax.swing.JPanel ; 6 7 import net.matuschek.swing.JHideFrame; 8 import net.matuschek.swing.OptionPanel; 9 12 13 14 15 21 public class FilterConfigFrame extends JHideFrame { 22 23 24 private static final long serialVersionUID = -115214206470304510L; 25 26 27 public FilterConfigFrame() { 28 super("Filter configuration"); 29 initComponents(); 30 } 31 32 33 protected void initComponents() { 34 JPanel mainPanel = new JPanel (); 35 mainPanel.setLayout(new BoxLayout (mainPanel,BoxLayout.Y_AXIS)); 36 setContentPane(mainPanel); 37 38 OptionPanel dialogPanel = new OptionPanel(2); 39 40 JPanel buttonPanel = new JPanel (); 41 buttonPanel.setLayout(new BoxLayout (buttonPanel,BoxLayout.X_AXIS)); 42 43 mainPanel.add(dialogPanel); 44 mainPanel.add(buttonPanel); 45 46 47 48 49 50 JButton okButton = new JButton (); 51 okButton.setText("OK"); 52 okButton.addActionListener(new java.awt.event.ActionListener () { 53 public void actionPerformed(java.awt.event.ActionEvent evt) { 54 updateAndHide(); 55 } 56 }); 57 buttonPanel.add(okButton); 58 59 JButton closeButton = new JButton (); 60 closeButton.setText("Cancel"); 61 closeButton.addActionListener(new java.awt.event.ActionListener () { 62 public void actionPerformed(java.awt.event.ActionEvent evt) { 63 exitForm(); 64 } 65 }); 66 buttonPanel.add(closeButton); 67 68 69 pack (); 70 } 71 72 73 76 protected void updateAndHide() { 77 this.setVisible(false); 78 } 79 80 81 82 83 84 85 } 86 87 | Popular Tags |