import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
public class HauptFrame {
public HauptFrame(String string) {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new HauptFrame("HauptFrame");;
}
public HauptFrame (String title) {
super(title);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setSize(300, 400);
JDesktopPane jDesktopPane = new JDesktopPane();
this.add(jDesktopPane);
JInternalFrame iFrame = new JInternalFrame("Internal Frame");
JPanel jPanel = new JPanel();
JButton jButton = new JButton();
jButton.setText("Click me");
jPanel.add(jButton);
iFrame.add(jPanel);
iFrame.setSize(200, 300);
iFrame.setVisible(true);
jDesktopPane.add(iFrame);
//Zweites JInternalFrame
JInternalFrame iFrame2 = new JInternalFrame("IF2");
iFrame2.setSize(300, 200);
iFrame2.setVisible(true);
jDesktopPane.add(iFrame2);
setVisible(true);
}
}
Erstes Programm mit Java!
Nicht von mir, "Java GUI MDI JDesktopPane" wemarLearning hats geschrieben.
Ich habe nur SAP programmiert.
Was mache ich alles falsch?
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
public class HauptFrame {
public HauptFrame(String string) {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new HauptFrame("HauptFrame");;
}
public HauptFrame (String title) {
super(title);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setSize(300, 400);
JDesktopPane jDesktopPane = new JDesktopPane();
this.add(jDesktopPane);
JInternalFrame iFrame = new JInternalFrame("Internal Frame");
JPanel jPanel = new JPanel();
JButton jButton = new JButton();
jButton.setText("Click me");
jPanel.add(jButton);
iFrame.add(jPanel);
iFrame.setSize(200, 300);
iFrame.setVisible(true);
jDesktopPane.add(iFrame);
//Zweites JInternalFrame
JInternalFrame iFrame2 = new JInternalFrame("IF2");
iFrame2.setSize(300, 200);
iFrame2.setVisible(true);
jDesktopPane.add(iFrame2);
setVisible(true);
}
}
Erstes Programm mit Java!
Nicht von mir, "Java GUI MDI JDesktopPane" wemarLearning hats geschrieben.
Ich habe nur SAP programmiert.
Was mache ich alles falsch?