Kuifje_007
Gebruiker
- Lid geworden
- 25 mrt 2004
- Berichten
- 209
Ik wil Java leren maken. Ik heb al boek Gertjan Laan doorgenomen. Nu probeer ik applicatie te maken maar als ik start, gebeurt er namelijk niets. Ik krijg ook geen foutmelding.
Kan iemand mij helpen?
Code:
package mijnapplicatie;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2008</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class inlogscherm extends JFrame {
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
Label label1 = new Label();
TextField textField1 = new TextField();
TextField txtInlogNaam = new TextField();
Label lbInlognaam = new Label();
Label lbWachtwoord = new Label();
TextField txtWachtwoord = new TextField();
//Construct the frame
public inlogscherm() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
contentPane = (JPanel) this.getContentPane();
getContentPane().setLayout(null);
label1.setText("label1");
//setLayout(null);
this.setSize(new Dimension(400, 300));
this.setTitle("Inlogscherm");
txtInlogNaam.setText("");
txtInlogNaam.setBounds(new Rectangle(60, 90, 250, 40));
lbInlognaam.setText("Inlognaam");
lbInlognaam.setBounds(new Rectangle(60, 60, 150, 36));
lbWachtwoord.setText("Wachtwoord");
lbWachtwoord.setBounds(new Rectangle(60, 160, 142, 28));
txtWachtwoord.setBounds(new Rectangle(60, 190, 250, 40));
contentPane.add(label1, BorderLayout.NORTH);
contentPane.add(textField1, BorderLayout.CENTER);
contentPane.add(txtInlogNaam, null);
contentPane.add(lbInlognaam, null);
contentPane.add(lbWachtwoord, null);
contentPane.add(txtWachtwoord, null);
}
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
public static void main( String[] args ) {
new inlogscherm();
}
}
Kan iemand mij helpen?
