Add "AddLabeledTextBox"
This commit is contained in:
parent
238759ad89
commit
ba814ad400
@ -7,8 +7,10 @@ public class Demo {
|
|||||||
// w.display();
|
// w.display();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
aufg gudWindow = new aufg("Mein Geilo GUI", 300, 420);
|
||||||
aufg gudWindow = new aufg("Title", 300, 420);
|
gudWindow.addLabeledTextField("TextBox");
|
||||||
|
gudWindow.addMenuBar();
|
||||||
gudWindow.display(true);
|
gudWindow.display(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ public class aufg {
|
|||||||
public void display(boolean exitOnClose){
|
public void display(boolean exitOnClose){
|
||||||
this.window.setTitle(this.title);
|
this.window.setTitle(this.title);
|
||||||
this.window.setSize(this.width, this.height);
|
this.window.setSize(this.width, this.height);
|
||||||
|
this.window.setContentPane(this.contentPane);
|
||||||
this.window.setVisible(true);
|
this.window.setVisible(true);
|
||||||
|
|
||||||
if (exitOnClose){
|
if (exitOnClose){
|
||||||
@ -61,4 +62,12 @@ public class aufg {
|
|||||||
|
|
||||||
this.window.setJMenuBar(this.menubar);
|
this.window.setJMenuBar(this.menubar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addLabeledTextField(String labelText){
|
||||||
|
JLabel label = new JLabel(labelText);
|
||||||
|
JTextField textField = new JTextField(10);
|
||||||
|
|
||||||
|
this.contentPane.add(label);
|
||||||
|
this.contentPane.add(textField);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user