Results 1 to 1 of 1
- 06-08-2010, 09:52 AM #1Member
- Join Date
- Jun 2010
- Rep Power
Location Issue on multiple screen
I am facing a problem, my application requirement to allow user to open as many JFrames (using some option), and move that to any monitor attached and then when application run again those frames should be at that location where they been left.
At start up there are total 3 monitors - and these are bounds of each -
1) Monitor Bounds [0,0,1280,1024]
2) Monitor Bounds [1280,0,2560,1024]
3) Monitor Bounds [2560,0,3840,1024]
I opened 4 windows and saved, at save i am saving location of frame (x,y) to file then loading, I did log what is the location of frames, and I see this -
1) Frame Title Frame 1 Frame State 0 Frame location [-28,6,457,530]
2) Frame Title Frame 2 Frame State 0 Frame location [453,3,760,550]
3) Frame Title Frame 3 Frame State 0 Frame location [1548,168,1041,522]
4) Frame Title Frame 4 Frame State 0 Frame location [1310,573,1000,500]
above bold -28 is surpising, as this does not fit to any monitor, that frame was on first monitor (#1) but location I got was of negative x, I taken care of frame minimized state too but that not an issue and surprising thing is that it does not happens all the time, 2 out of 8 times I do see this issue, on rest same frames same position works well.
Not sure what is the issue.
to get monitor location (to print) I used GraphicsConfiguration as it should
and to save I just call frame.getLocationOnScreen(). there is not much of code to provide here.
Thanks in advance.
- By sidd0123 in forum New To JavaReplies: 3Last Post: 06-06-2010, 02:02 AM
- By afrodom in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 03-06-2010, 06:04 PM
- By naveen.dpt2007 in forum New To JavaReplies: 4Last Post: 02-28-2010, 04:53 PM
- By sandeeprao.techno in forum CLDC and MIDPReplies: 0Last Post: 09-24-2009, 09:54 AM
- By mohana.krishna in forum Java ServletReplies: 0Last Post: 03-03-2009, 06:03 PM