Re: adding a List of JTextField to the GUI
- From: Mark Space <markspace@xxxxxxxxxxxxxx>
- Date: Sun, 27 Jul 2008 22:47:10 -0700
thufir wrote:
here's what I have:
If all you need right now is just to get some labels and text fields displayed, you could do it by adding a label and a text field to one panel, then just stack the panels on top of each other. That's not nearly as sophisticated as what the GroupLayout will let you do, but it'll get you a working JFrame.
class TestApp extends JFrame {
TestApp() {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
add(panel);
for (int i = 1; i <= 4; i++) {
JPanel nuPanel = new JPanel();
nuPanel.add(new JLabel("Label " + i));
nuPanel.add(new JTextField(i * 4));
panel.add(nuPanel);
}
pack();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
}
public static void main(String[] args) {
new TestApp().setVisible(true);
}
}
.
- References:
- adding a List of JTextField to the GUI
- From: thufir
- Re: adding a List of JTextField to the GUI
- From: Mark Space
- Re: adding a List of JTextField to the GUI
- From: Mark Space
- Re: adding a List of JTextField to the GUI
- From: thufir
- Re: adding a List of JTextField to the GUI
- From: Mark Space
- Re: adding a List of JTextField to the GUI
- From: thufir
- adding a List of JTextField to the GUI
- Prev by Date: Re: installing jdk6 on jdk5
- Next by Date: Use yahoo mail for authentication
- Previous by thread: Re: adding a List of JTextField to the GUI
- Next by thread: [General]acces of members of subclass
- Index(es):
Relevant Pages
|