Java Reference
In-Depth Information
314 }
315
316 // build the pieces and add them to the top-level container
317
318 Component status = app.createStatus();
319 frame.getContentPane().add(status, BorderLayout.NORTH);
320
321 Component list = app.createList();
322 frame.getContentPane().add(list, BorderLayout.CENTER);
323
324 Component buttons = app.createButtons(frame.getRootPane());
325 frame.getContentPane().add(buttons, BorderLayout.SOUTH);
326
327 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
328 frame.pack();
329 frame.setVisible(true);
330 } // main
331
332 } // class BudgetPro
Here is the code for the dialog for creating new accounts,
AcctDialog.java :
1 package net.multitool.gui;
2
3 import java.awt.*;
4 import java.awt.event.*;
5 import javax.swing.*;
6 import javax.swing.table.*;
7 import java.util.*;
8 import net.multitool.core.*;
9
10 class
11 AcctDialog
12 extends JDialog
13 {
14 JDialog dialog; // for reference from the buttons' actions
15 JTextField nameField;
16 JTextField amntField;
17
18 AcctDialog(JFrame frame, String title)
19 {
20 super(frame, title, true);
21 dialog = this;
22 nameField = new JTextField(25);
23 amntField = new JTextField(9);
Search WWH ::




Custom Search