Browse Source

nicer fullscreen (still in progress)

Max Nuding 12 years ago
parent
commit
d3a56cb0e8
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      CubeControl/Frame.java

+ 8
- 1
CubeControl/Frame.java View File

36
 	private GraphicsConfiguration gConfig;
36
 	private GraphicsConfiguration gConfig;
37
 	private Canvas3D cubeCanvas;
37
 	private Canvas3D cubeCanvas;
38
 	public Led3D ledView;
38
 	public Led3D ledView;
39
+	private Container cp;
39
 	private JButton editA = new JButton();
40
 	private JButton editA = new JButton();
40
 	private JButton editB = new JButton();
41
 	private JButton editB = new JButton();
41
 	private JButton editC = new JButton();
42
 	private JButton editC = new JButton();
340
 		int x = (d.width - frameWidth) / 2;
341
 		int x = (d.width - frameWidth) / 2;
341
 		int y = (d.height - frameHeight) / 2;
342
 		int y = (d.height - frameHeight) / 2;
342
 		setLocation(x, y);
343
 		setLocation(x, y);
343
-		Container cp = getContentPane();
344
+		cp = getContentPane();
344
 		cp.setLayout(null);
345
 		cp.setLayout(null);
345
 
346
 
346
 		// ----- 3D Stuff -----
347
 		// ----- 3D Stuff -----
580
 		fullScreenButton.addActionListener(new ActionListener() {
581
 		fullScreenButton.addActionListener(new ActionListener() {
581
 			public void actionPerformed(ActionEvent evt) {
582
 			public void actionPerformed(ActionEvent evt) {
582
 				ledView.enterFullscreen();
583
 				ledView.enterFullscreen();
584
+				dispose();
585
+				setUndecorated(true);
586
+				setVisible(true);
583
 				setLocation(0,0);
587
 				setLocation(0,0);
584
 				setSize(700, 700);
588
 				setSize(700, 700);
585
 				int w = Toolkit.getDefaultToolkit().getScreenSize().width;
589
 				int w = Toolkit.getDefaultToolkit().getScreenSize().width;
596
 		cp.add(exitButton);
600
 		cp.add(exitButton);
597
 		exitButton.addActionListener(new ActionListener() {
601
 		exitButton.addActionListener(new ActionListener() {
598
 			public void actionPerformed(ActionEvent evt) {
602
 			public void actionPerformed(ActionEvent evt) {
603
+				dispose();
604
+				//setUndecorated(false);
605
+				setVisible(true);
599
 				playAnimationFullscreen.setVisible(false);
606
 				playAnimationFullscreen.setVisible(false);
600
 				toggleLegsButtonFullscreen.setVisible(false);
607
 				toggleLegsButtonFullscreen.setVisible(false);
601
 				setLocation(0,0);
608
 				setLocation(0,0);

Loading…
Cancel
Save