hey ich hab den halben tag damit verbracht ein frame zu programmieren in dem mehrere dinge zu sehen sind und auch angeordnet sein sollen! ihr kennt es alle von windows... wenn ihr z.b eine datei sucht und links den FileTree habt... naja aufjedenfall finde ich es ziemlich naja umständlich und nun meine frage wie könnte ich das ganze vereinfachen/ verbessern
Java:
public class test extends JTree{
public static void main( String[] args )
{
JFrame frame = new JFrame("DatenTree");
//HauptBox
Box mainBox = Box.createVerticalBox();
frame.add(mainBox);
//KopfleistenBox
Box headBox = Box.createHorizontalBox();
//FieldBox
Box fieldBox=Box.createHorizontalBox();
//Links
Box leftBox= Box.createVerticalBox();
//rechts
Box rightBox= Box.createVerticalBox();
mainBox.add(headBox);
mainBox.add(fieldBox);
fieldBox.add(leftBox);
leftBox.add( new JScrollPane( new FileTreeTest() ) );
fieldBox.add(rightBox);
rightBox.add(new TextField("halloooooooo"));
headBox.add(new TextField("File..."));
headBox.add(new JButton("Öffnen"));
JPanel bodyPanel = new JPanel(new CardLayout());
mainBox.add(bodyPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
Zuletzt bearbeitet: