Screen « JFrame « Java Swing Q&A





1. Why does windows XP minimize my swing full screen window on my second screen?    stackoverflow.com

In the application I'm developping (in Java/swing), I have to show a full screen window on the second screen of the user. I did this using a code similar to the one ...

2. How to call setUndecorated() after a frame is made visible?    stackoverflow.com

In my Swing application, I want the ability to switch between decorated and undecorated without recreating the entire frame. However, the API doesn't let me call setUndecorated() after the frame is ...

3. Floating Rectangle on Screen    stackoverflow.com

I know how to draw a rectangle onto a JPanel, but how can I paint a rectangle to the screen so that the rectangle appears to be floating? More specifically, a ...

4. how do i clear my frame screen in java?    stackoverflow.com

I am making a brick game. I want the screen to get clear after every 0.1 second so that i can redraw every thing on the frame screen. Is there any way ...

5. how to have more than one JToolBar in one screen?    stackoverflow.com

How to put more than one JToolBar on one screen and allow them floating. Usually we put JToolBar on a container with BorderLayout. if we put all JToolBars on a panel ...

6. Java (Swing): finding a component's *screen* size when the window is resized    stackoverflow.com

I need to find a component's exact screen size in pixels when the main JFrame is resized. I've tried several things and couldn't find an easy way to do it: ...

7. Get the screen device information of the display where the JFrame is currently located    stackoverflow.com

I'm trying to find out on which of my two displays a JFrame is. I appreciate any help ;)

8. White Screen when switching between Swing frames under Linux    stackoverflow.com

I'm porting a Java Swing application from Windows to Linux. On Linux - when the application switches between JFrames, a blink of white screen appears for a split of a second. This doesn't ...

9. java, show JFrame in a specific screen in dual monitor configuration    stackoverflow.com

i have a dual monitor config and i want to run my GUI in a specific monitor if it is found. I tried to create my JFrame window passing a GraphicConfiguration object ...





10. Showing JFrame in a non Raster Graphics Configuration    stackoverflow.com

Greetings, I'm trying to get a JFrame drawing in a non screen device. The JFrame constructor has a

 JFrame(GraphicsConfiguration) 
to seemingly allow this: My First attempt was to create my own ...

11. Why setExtendedState(JFrame.ICONIFIED)does not work while windows screen locked?    stackoverflow.com

all. i want to minimize my jframe with setExtendedState(JFrame.ICONIFIED), in most case, it works properly, but when it does not work when i lock my os(windows XP) screen with WIN+L.My wimple code ...

12. GraphicsDevice - can't return from fullscreen    stackoverflow.com

I'm currently trying to make a full-screen window in Java running in Linux. The thing is I can actually make the JFrame full-screen but if the frame is set undecorated it ...

13. Find which screen window is on    stackoverflow.com

How can I detect which screen a JFrame is located on? I need to find the screen and resize the frame to make sure it is not larger than the relevant ...

14. Java JFrame Size according to screen resolution    stackoverflow.com

I created java GUI using myEclipse Matisse. when my Screen Resolution is 1024x768 it works fine but when i change resolution my GUI is not working fine. I want my GUI ...

15. JFrame multiple screens    stackoverflow.com

I have been programming in Android and I switch between specific screens using intents. I have always wondered how to do this in Java, when I click a button switch to ...

16. Fullscreen frame in Swing    stackoverflow.com

With the command "GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();" i can get the screen size, but i dont know how to set this size in my frame. I want to configure my frame to always be adjusted in ...





17. VolatileImage JFrame on multiple screens    stackoverflow.com

I have a JFrame in which I am using Graphics2D to draw a VolatileImage using this tutorial. I have mainly copied the code to see how it works, but ...

18. Java Swing: How can I implement a login screen before showing game screen?    stackoverflow.com

I'm trying to make a little game that will first show the player a simple login screen where they can enter their name (I will need it later to store their ...

19. Adjust the image as per screen resolution of window    stackoverflow.com

I have add a JLabel in a JFrame and one image of size 1024x768 is added in JLabel. When I set the resolution of window screen in 1024x768 the and run the application ...

20. Splash Window does not appear - Swing    stackoverflow.com

I have a splash screen for my swing application and wrote the below manifest file. I placed the png file that splash window should show into a directory named resources under ...

21. how to get screen shot of the entire frame (including the parts clipped out)    stackoverflow.com

I want to save a screenshot of my entire frame, but my problem is when i try to do this with my current code, if i made the size of my ...

22. JFrame Startup on screen - GUI    forums.netbeans.org

//Center the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = frame.getSize(); if (frameSize.height > screenSize.height) { frameSize.height = screenSize.height; } if (frameSize.width > screenSize.width) { frameSize.width = screenSize.width; } frame.setLocation((screenSize.width - ...

23. Display Frame on Center of Screen    coderanch.com

24. Center a Frame on the Screen    coderanch.com

Here is how I did it for a dialog box. It seems like there should be a more efficient way to center your frame by using Toolkit.getDefaultToolkit().... somehow. You can get the screen size from the default toolkit and use it to set the location and size of the frame. public void jMenuHelpAbout_actionPerformed(ActionEvent e) { mainFrame_AboutBox dlg = new mainFrame_AboutBox(this); Dimension ...

25. Chaning screen in Frames    coderanch.com

Hi, I am using Jframes to develop my application. I use a Frame to display my authentication screen. The constructor for the main class creates the authentication screen and it call setVisible(true) to display the screen. Once I user the enters the details the details are verified against the database and if the verfication is successful I want to transfer the ...

26. JFrame on Screen Size    coderanch.com

27. Window size wierdness with Full-Screen Exclusive    coderanch.com

Hey all, I'm delving into the Java 1.4 Full-Screen Exclusive Mode API because, well, because it's there! Anyhow, I have an app in which the user can switch between a normal, little JFrame and a bigger, undecorated JFrame in fullscreen mode. I do also set the display mode (in this case, to 800x600). My problem is that after all that happens, ...

28. How to get a new Frame on the center of the screen?    coderanch.com

hi guys, I have a small GUI which will open different frames when you select each item. What I don't like, is that whenever the program opens a new Frame, it appears in the top left corner of the screen. Is it possible to make it appear in the center of the screen? Thanks

29. A window to the centre of the screen    coderanch.com

30. Centre window on leftmost screen with multiple monitors    coderanch.com

If you know that they're going to be running in 1024 x 768 resolution then it's a simple matter of using a formula like this - Frame frame = //whatever int fullWidth = Toolkit.getDefaultToolkit().getScreenSize().width; int x = fullWidth - ( ( 1024 - frame.getSize().width ) / 2 ); int y = ( 768 - frame.getSize().height ) / 2; frame.setLocation( x, y ...

31. Question about splach screen + Jframe    coderanch.com

It's probably not finding your image. Are you getting any errors? Where is your image? in a folder on disk? in a .jar? and what did you pass in to the constructor telling it where the image is? If the image is in your .jar, you can give it something like: new Splash("images/splash.jpg", 3, true); This will load the image splash.jpg ...

32. how to create a full screen window?    coderanch.com

33. A splash screen on JFrame    coderanch.com

36. How to set Jframe to full screen    coderanch.com

Yes it is a bit shorter but that is not the only advantage. The setState method actually maximizes the window just like when you click on the maximize button on your window. When calling the setSize (setBounds) methods the window never gets in the maximized state (not even when you make it as large as the screen).

37. full-screen gray window problem and event handling problem    coderanch.com

compare your to this, compare the differences import java.awt.*; import java.awt.event.*; import javax.swing.*; class FullScreen extends JPanel implements KeyListener { public FullScreen() { setFocusable(true);//default is false addKeyListener(this);//need to add the listener setPreferredSize(new Dimension(600,400));//adjust to full screen later setBackground(Color.BLUE); } public void paintComponent (Graphics g) { super.paintComponent(g);//should have this line g.setColor(Color.WHITE); g.drawString("Hello, World!", 50, 50); g.drawLine(0, 1000, 500, 0); } public void ...

38. Maximising a frame to fullscreen on start-up?    coderanch.com

import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JTextField; import java.awt.*; import javax.swing.JButton; public class MyFrame extends JFrame { BorderLayout borderLayout1 = new BorderLayout(); JTextField jTextField1 = new JTextField(); JButton jButton1 = new JButton(); public MyFrame() { try { jbInit(); } catch (Exception exception) { exception.printStackTrace(); } } private void jbInit() throws Exception { getContentPane().setLayout(borderLayout1); jTextField1.setText("jTextField1"); jButton1.setText("jButton1"); this.getContentPane().add(jTextField1, java.awt.BorderLayout.CENTER); this.getContentPane().add(jButton1, java.awt.BorderLayout.NORTH); } public static ...

39. Maximising Frame window to fit to screen    coderanch.com

Hi Guys, Iam new to Swing &about to start with my first GUI. Had some questions to begin with.Thought of asking the experienced guys over here. I have JFrame,as my top level container.want the frame to be maximised or fit to the screen of the computer on which it is running?.What is the best way to do it. Also,In the content ...

40. JFrame not fitting to screen.    coderanch.com

Hello friends, I want to make a jframe which is the top level window with a menu bar. It is going to be the first screen of my project. I want that when the program is executed the window is opened in complete screen. I have rummaged places for it but cant find how it can fit the complete screen when ...

41. get window on viewable screen    coderanch.com

I am writing my GUI today, been at it for a day or two working off of previous work. I struggled earlier trying to get the constructor to place something reasonable on the screen. I got one code version to work, that was months ago. Here is what is probably useable from the earlier effort: /**** Scalable presentation ****/ double horzHorizon ...

42. How to load a new screen on a JFrame    coderanch.com

I'm new to Swing/AWT, and I've been fooling around with it lately. I know that you can use repaint() to refresh a JFrame, but that will only re-perform the code that applies to the JFrame, but I want to have a button on the two buttons on the left. When you click the first button, there will be a text field ...

43. Show images on the screen without using JFrame    coderanch.com

No, they are still in a Frame. I've retrieved it for showing modal dialogs. Of course you should treat Applets as top-level as far as creating components goes (i.e. you don't add it to anything yourself), but it certainly is not a top-level component in the same way as Frame or Dialog are. [ October 23, 2008: Message edited by: Rob ...

44. How to make JFrame get to the center of screen    coderanch.com

import java.awt.Dimension; import java.awt.Toolkit; //import other required packages /** * * @author chaithika */ public class makecenter extends javax.swing.JFrame { public makecenter() { //create the frame //make frame center Dimension dim=Toolkit.getDefaultToolkit().getScreenSize(); int framewidth=this.getSize().width;//get the width of the frame int frameheigth=this.getSize().height; //get the heigth of the frame int framelocationX=(dim.width-framewidth)/2; int framelocationY=(dim.height-frameheigth)/2; this.setLocation(framelocationX,framelocationY); //end of entering } }

45. Size of JFrame according to screen    coderanch.com

46. unable to clear text box in Multi Screen JFrame GUI Application    coderanch.com

i am working with a Swing GUI project where I want to accept user input in a text field I have used singleton pattern which will create only one instance of object due to this when i move from one scree to another the input of textfield doesnt updated I have used setText method to clear the JTextField but it wont ...

47. full screen size of JFRame in swing    coderanch.com

50. Prob. with screen resolution and Frame size??    java-forums.org

I have a prob. in Designing Frame. Is it possible in Java that Frame size and Components contained in it adjust automatically with the screen resolution. The design which looks good in my Laptop looks worst in my Desktop. What I want is Frame size and components position (I have taken Null Layout with setLocation and SetSize) should adjust according to ...

51. XTerm window appearing in full screen swing app    java-forums.org

Hi all, I have a full-screen Swing app running on a Linux machine and using the IBM JVM. I start this application via command line in a Xterm window. Depending on user interaction, I have different pop-up windows displayed (confirmation msgs, alerts, etc). Sometimes, after a user closes such a pop-up window (e.g.: clicking on the "Ok" button), the Xterm window ...

52. Full Screen Frame Resolution Problem    java-forums.org

Hello, I am working on a project where I use a full size undecorated frame for my GUI. My problem is that everything looks perfect on my laptop that I work on (I don't know the resolution because I'm at school) As I was testing cross platform issues I discovered that my GUI will mess up under certain resolutions. This is ...

53. Full Screen window over toolbar    java-forums.org

54. JFrame at Center Screen    java-forums.org

56. Setting JFrame to Fullscreen w/o Bar    java-forums.org

I am trying to set a JFrame I have open to full screen, but I want to get rid of the bar at the top. I want this frame to be able to switch from full screen to windowed mode, and I want it to have the bar in windowed mode, so I can't just create it initially with the setUndecorated ...

57. problem with JFrames in different screens    java-forums.org

hellow my friends i have a problem with a small java program that i made the JFrames of the program are implemented based on my 17 inches screen and 1280*800 resolution i design all the components based on my screen have in mind that the layput pollicies for the JFrames are set to null when i will execude my program on ...

60. JFrame is always full screen    forums.oracle.com

61. Displaying a JFrame at the centre of the screen    forums.oracle.com

hi all, extremely sorry for the late response, i tried all, but none of them working, when i run the bean, first the frame blink at the center of the screen for a second and then display it at the top left corner of the screen. still cannot find the reason, Edited by: dush82 on Oct 3, 2007 9:07 PM Edited ...

62. How do I track mouse movements on the whole screen, not just a JFrame?    forums.oracle.com

I need to track the mouse on the whole screen. The reason for this is that I need to have a window selected while my program is running that is not a Java window. As soon as the mouse is not focused over my JFrame, the mouse motion listener stops working. How can I acomplish this? Thanks, Eric