1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| public class CreatorFrame extends JFrame {
private JPanel mapArea = new JPanel();
private JPanel elementArea = new JPanel();
private JSplitPane container;
public CreatorFrame(){
/* Set Frame configuration */
setLocationRelativeTo(null);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle(Constants.SOFTWARE_NAME);
setExtendedState(this.MAXIMIZED_BOTH);
setLayout(new BorderLayout());
/*Set elementArea configuration */
Element element = new Element("/res/Box_Green.png","BoxGreen");
elementArea.add(element);
container = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,mapArea,elementArea);
container.setRightComponent(elementArea);
container.setLeftComponent(mapArea);
container.setDividerLocation(0.5);
getContentPane().add(container, BorderLayout.CENTER);
}
} |