G
Guest
Gast
In folgendem Programm wird kein JScrollPane eingeblendet auch wenn sich die Grafik die sich in der GraphicView befindet über den Bereich der anezeigt werden kann hinaus erstreckt.
Könnt ihr mir verraten was ich anders machen muß damit das mit dem JScrollPanel klappt?
Könnt ihr mir verraten was ich anders machen muß damit das mit dem JScrollPanel klappt?
Code:
public class Main extends JFrame
{
public Main()
{
Model model = new Model();
this.setLayout(new BorderLayout());
TreeView dv = new TreeView(model);
this.add(dv, BorderLayout.WEST);
GraphicView gv = new GraphicView(model);
JScrollPane pane = new JScrollPane();
pane.setViewportView(gv);
this.add(pane, BorderLayout.CENTER);
ControlPanel iv = new ControlPanel(model);
this.add(iv, BorderLayout.SOUTH);
DialogBox db = new DialogBox(model, this);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setSize(800,800);
this.setVisible(true);
}
public static void main(String[] args)
{
new Main();
}
}