28. november 2001 - 09:30
#4
Jeg er ikke helt sikker. Her er min kildekode: (lavet med JDeveloper, så den er garanteret ikke den mest effektive)
package package1;
import javax.swing.*;
import java.awt.*;
import oracle.dacf.control.swing.*;
import oracle.jdeveloper.layout.*;
import oracle.dacf.layout.*;
import java.awt.event.*;
public class frame1 extends JFrame {
JPanel jPanel1 = new JPanel();
CardLayout cardLayout1 = new CardLayout();
JLabel jLabel2 = new JLabel();
XYLayout xYLayout2 = new XYLayout();
JLabel jLabel1 = new JLabel();
JPanel jPanel2 = new JPanel();
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel3 = new JLabel();
JPasswordField jPasswordField1 = new JPasswordField();
JTextField jTextField1 = new JTextField();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JPanel jPanel3 = new JPanel();
XYLayout xYLayout3 = new XYLayout();
JButton jButton3 = new JButton();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
/**
* Constructs a new instance.
*/
public frame1() {
super();
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
/**
* Initializes the state of this instance.
*/
private void jbInit() throws Exception {
this.getContentPane().setLayout(xYLayout2);
this.setSize(new Dimension(424, 425));
jLabel2.setText(\"CPR\");
jLabel1.setFont(new Font(\"Dialog\", 0, 18));
jLabel3.setText(\"Kode\");
jLabel3.setFont(new Font(\"Dialog\", 0, 18));
jButton1.setText(\"Log ind\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
jButton2.setText(\"Afslut\");
jButton3.setText(\"Fastansat\");
jButton4.setText(\"Institutleder\");
jButton5.setText(\"Lønanviser\");
jPanel3.setLayout(xYLayout3);
jPanel2.setLayout(xYLayout1);
jLabel1.setText(\"CPR\");
jPanel1.setLayout(cardLayout1);
this.setTitle(\"Over-/merarbejde\");
this.getContentPane().add(jPanel1, new XYConstraints(0, 15, -1, 383));
jPanel1.add(jPanel2, \"jPanel2\");
jPanel2.add(jLabel1, new XYConstraints(27, 13, 66, -1));
jPanel2.add(jLabel3, new XYConstraints(26, 61, -1, -1));
jPanel2.add(jPasswordField1, new XYConstraints(27, 85, 141, -1));
jPanel2.add(jTextField1, new XYConstraints(25, 36, 143, -1));
jPanel2.add(jButton1, new XYConstraints(66, 117, -1, -1));
jPanel1.add(jPanel3, \"jPanel3\");
jPanel3.add(jButton3, new XYConstraints(65, 27, -1, -1));
jPanel3.add(jButton4, new XYConstraints(60, 54, -1, -1));
jPanel3.add(jButton5, new XYConstraints(62, 81, -1, -1));
this.getContentPane().add(jButton2, new XYConstraints(346, 4, -1, -1));
}
void jButton1_actionPerformed(ActionEvent e) {
((CardLayout) cardLayout1.getLayout()).show(cardLayout1, \"jPanel3\");
}
}