简体   繁体   中英

How do I Start Eclipse project with GUI windows spaced out?

I'm running a large Java Eclipse project and when it starts up, I see 3 pop-up windows tiled on top of each other, as so:

在此处输入图片说明

I need to have them start up separated positions, as I'm always testing the program and dragging the windows. Can I somehow put them all in a bigger GUI window(pane)?

Use setLocation() method

windowName.setLocation(location_parameters);

passing the 'null' as an argument will make the window center.

There is another way,

setLocationRelatedTo(item_to_relate)

method. this will locate them according to the existing things like JLabels, existing windows, etc.

Can I somehow put them all in a bigger GUI window(pane)?

You presently have 3 JFrame s, I think.

You could change this to 3 JPanel s in one frame.

You would use a layout manager to arrange the 3 JPanel s the way you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM