Hallo,
ich habe die DockingFrames von der Seite http://dock.javaforge.com/help.html verwendet.
Mein Problem ist jetzt, dass, wenn ich den JButton vom Programm unten drücke, ein neuer DockingFrame hinzugefügt werden soll (station.drop(new DefaultDockable( "Beschreibung" ), SplitDockProperty.EAST );
);
Das funktioniert auch aber das Problem ist, wenn ich die Größe des DockingFrames in East ändere, ein neuer JFrame in East erzeugt wird und nicht ein JFrame zu den bestehenden hinzugefügt wird,
Hat da jemmand eine Idee, wie man das machen kann,
Vielen Dank,
lg
(PS: Das Programm unten funktioniert)
ich habe die DockingFrames von der Seite http://dock.javaforge.com/help.html verwendet.
Mein Problem ist jetzt, dass, wenn ich den JButton vom Programm unten drücke, ein neuer DockingFrame hinzugefügt werden soll (station.drop(new DefaultDockable( "Beschreibung" ), SplitDockProperty.EAST );
);
Das funktioniert auch aber das Problem ist, wenn ich die Größe des DockingFrames in East ändere, ein neuer JFrame in East erzeugt wird und nicht ein JFrame zu den bestehenden hinzugefügt wird,
Hat da jemmand eine Idee, wie man das machen kann,
Vielen Dank,
lg
(PS: Das Programm unten funktioniert)
Code:
package javaapplication15;
import bibliothek.gui.dock.station.split.SplitDockProperty;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import bibliothek.gui.DockController;
import bibliothek.gui.dock.station.SplitDockStation;
import bibliothek.*;
import bibliothek.extension.gui.dock.theme.EclipseTheme;
import bibliothek.gui.DockTheme;
import bibliothek.gui.dock.DefaultDockable;
import bibliothek.gui.dock.station.SplitDockStation;
import java.awt.event.ActionListener;
import javax.swing.JButton;
class Main implements ActionListener
{
SplitDockStation station;
public Main()
{
JButton button = new JButton("addPanel");
button.setBounds(20,20,200,80);
button.addActionListener(this);
DockController controller = new DockController();
controller.setSingleParentRemove( true );
station = new SplitDockStation();
DockTheme theme = new EclipseTheme();
controller.setTheme( theme );
controller.add(station);
controller.add( station );
DefaultDockable dD = new DefaultDockable( "One");
dD.getContentPane().add(button);
station.drop(dD , SplitDockProperty.NORTH );
station.drop( new DefaultDockable( "Two" ), SplitDockProperty.NORTH );
station.drop( new DefaultDockable( "Three" ), SplitDockProperty.EAST );
station.drop( new DefaultDockable( "Four" ), SplitDockProperty.EAST );
JFrame frame = new JFrame();
frame.add( station.getComponent() );
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.setBounds( 20, 20, 400, 400 );
frame.setVisible( true );
}
public static void main( String[] args ){
Main main = new Main();
}
public void actionPerformed(ActionEvent e) {
station.drop(new DefaultDockable( "Beschreibung" ), SplitDockProperty.EAST );
}
}