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

Loading…
Cancel
Save