Hey!
Warum werden meine Komponenten speziell das JSplitPane erst nach dem Resize des Fensters sichtbar?
Ich Hoffe ihr könnt mir Helfen.
Danke schonmal!
Warum werden meine Komponenten speziell das JSplitPane erst nach dem Resize des Fensters sichtbar?
Java:
package com.ludevstudio.passwordmanager;
import java.awt.BorderLayout;
import javax.swing.JFrame;
public class MainFrame extends JFrame{
/* This Class contains the Main Frame
This is only the blank window. */
MainPane mainPane;
// Set params for the Window
public MainFrame() {
setTitle("Password Manager v1.0");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new BorderLayout() );
setVisible(true);
// only in Dev Phase:
setSize(800, 800);
setLocationRelativeTo(null);
initComponents(); // Call initComponents
}
// init and add the Panels
public void initComponents() {
mainPane = new MainPane();
add(mainPane, BorderLayout.CENTER);
}
}
Java:
package com.ludevstudio.passwordmanager;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JSplitPane;
public class MainPane extends JSplitPane {
// This Class contains the main Interface.
// Set params for the Pane
public MainPane() {
setLeftComponent(new ManagerPanel());
setRightComponent(new ActionsPanel());
setDividerLocation(500);
}
}
Java:
package com.ludevstudio.passwordmanager;
import java.awt.Dimension;
import javax.swing.JPanel;
public class ManagerPanel extends JPanel{
// This Class contains the Manager
// Constructor and params
public ManagerPanel() {
setMinimumSize(new Dimension(400, 100));
}
}
Java:
package com.ludevstudio.passwordmanager;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JPanel;
public class ActionsPanel extends JPanel{
// THis Class contains the Action Buttons on the right side.
// Constructor and params
public ActionsPanel() {
setBackground(Color.BLUE);
setMinimumSize(new Dimension(150, 150));
setMaximumSize(new Dimension(200, 1000));
}
}
Ich Hoffe ihr könnt mir Helfen.
Danke schonmal!