Results 1 to 2 of 2
Thread: Fullscreen mode problems
- 04-01-2009, 02:29 PM #1
Member
- Join Date
- Jun 2008
- Posts
- 56
- Rep Power
- 0
Fullscreen mode problems
Hello all, I've tried to create simple fullscreen app in Java. And I have some problems with it. Take a look at dialog which need to be displayed above the form. Try to drag it. (I've tested on JDK 5 and 6) Does it possible to fix such problems at all?
Thanks.Java Code:import javax.swing.*; import java.awt.*; /** * @author Victar Liaskovich */ public class Fullscreen { public static void main(String[] args) throws Exception { System.out.println("Probando Full Screen..."); JFrame fr = new JFrame(); fr.setTitle("Test Title"); fr.getContentPane().add(new JLabel("Test content")); fr.setResizable(false); // fr.setPreferredSize(new Dimension(1024, 768)); // fr.pack(); if (!fr.isDisplayable()) { fr.setUndecorated(true); } GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); gd.setFullScreenWindow(fr); fr.setVisible(true); MyDialog dlg = new MyDialog(fr); dlg.setLocationRelativeTo(fr); dlg.setVisible(true); Thread.sleep(10000); System.exit(0); } static class MyDialog extends JDialog { MyDialog(Frame frame) throws HeadlessException { super(frame, "Parent dialog", false); initComponents(); setPreferredSize(new Dimension(640, 480)); pack(); } private void initComponents() { JPanel panel = new JPanel(new FlowLayout(0, 0, FlowLayout.CENTER)); JButton jButton = new JButton("Show dialog"); panel.add(jButton); getContentPane().setLayout(new BorderLayout()); getContentPane().add(panel, BorderLayout.NORTH); } } }Try Controls4J - Advanced Swing Components.
- 04-01-2009, 04:07 PM #2
Member
- Join Date
- Feb 2009
- Posts
- 22
- Rep Power
- 0
Similar Threads
-
Finding the Mode in An Array
By carlodelmundo in forum New To JavaReplies: 23Last Post: 10-31-2010, 12:44 PM -
Setting JPanel to a fullscreen
By hitmen in forum New To JavaReplies: 3Last Post: 03-15-2009, 04:27 PM -
How to enable debug mode in eclipse
By msgbharath in forum New To JavaReplies: 3Last Post: 01-10-2009, 02:20 AM -
how to print utf8 formatted(.txt) file from DOS mode
By logic in forum New To JavaReplies: 1Last Post: 12-21-2008, 11:24 PM -
[SOLVED] Array Mode Problem
By Banjo in forum New To JavaReplies: 6Last Post: 12-09-2008, 04:35 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks