...
so gehts dann also, oder ?
------
package frametest1;
import java.awt.*;
import java.awt.event.*;
public class Myframe2
extends Frame
{
public static void main(String[] args)
{
Myframe2 wnd = new Myframe2();
wnd.setLocation(100,100);
wnd.setSize(300,200);
wnd.setVisible(true);
}
public Myframe2()
{
super("Test Gridlayout");
addWindowListener(new windowclose(true));
//Layout setzen und Komponenten hinzufügen
setLayout(new GridLayout(1,2));
int a = 1;
switch (a)
{
case 1: add(Mypanel1);
add(Mypanel2); break;
case 2: add(Mypanel3);
add(Mypanel4); break;
default:
System.out.println("Falscher Wert!");
}
pack();
}
}
so gehts dann also, oder ?
------
package frametest1;
import java.awt.*;
import java.awt.event.*;
public class Myframe2
extends Frame
{
public static void main(String[] args)
{
Myframe2 wnd = new Myframe2();
wnd.setLocation(100,100);
wnd.setSize(300,200);
wnd.setVisible(true);
}
public Myframe2()
{
super("Test Gridlayout");
addWindowListener(new windowclose(true));
//Layout setzen und Komponenten hinzufügen
setLayout(new GridLayout(1,2));
int a = 1;
switch (a)
{
case 1: add(Mypanel1);
add(Mypanel2); break;
case 2: add(Mypanel3);
add(Mypanel4); break;
default:
System.out.println("Falscher Wert!");
}
pack();
}
}