/** * Initializes the frame with no title. */ public BaseFrame() { super(); initialize(); initGUI(); finishInit(); }
/** * For testing only. * * @param args first argument is interpreted as script */ public static void main(String[] args) { BaseFrame frame; JShellPanel panel; panel = new JShellPanel(); panel.addJShellListener((JShellEvent e) -> System.out.println(e.getType())); frame = new BaseFrame("JShell"); frame.setIconImage(GUIHelper.getIcon("jshell.gif").getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(panel, BorderLayout.CENTER); frame.setSize(1200, 900); frame.setDefaultCloseOperation(BaseFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); } }
final BaseFrame frame = new BaseFrame("FontChooser Startup"); final FontChooser chooser = new FontChooser(frame); chooser.setCurrent(null); frame.getContentPane().setLayout(new GridLayout(0, 1)); frame.getContentPane().add(button); frame.getContentPane().add(label); frame.setSize(150, 100); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
/** * Initializes the widgets. */ protected void initGUI() { setIconImage(GUIHelper.getIcon("waikato.png").getImage()); }
public void actionPerformed(ActionEvent e) { chooser.setVisible(true); Font myNewFont = chooser.getCurrent(); System.out.println("You chose " + myNewFont); label.setFont(myNewFont); frame.pack(); chooser.dispose(); } });
final BaseFrame frame = new BaseFrame("FontChooser Startup"); final FontChooser chooser = new FontChooser(frame); chooser.setCurrent(null); frame.getContentPane().setLayout(new GridLayout(0, 1)); frame.getContentPane().add(button); frame.getContentPane().add(label); frame.setSize(150, 100); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void actionPerformed(ActionEvent e) { chooser.setVisible(true); Font myNewFont = chooser.getCurrent(); System.out.println("You chose " + myNewFont); label.setFont(myNewFont); frame.pack(); chooser.dispose(); } });
/** * Initializes the frame with the specified title. * * @param title the title to use */ public BaseFrame(String title) { super(title); initialize(); initGUI(); finishInit(); }