Question

I have jLabel with an icon wanna put in right top corner , in Netbeans design view I place it to a desired position , After running program it is stay there fine ! But when I maximize the window it doesn't horizontally move to the corner and keep its position. It becomes like in the middle.

Thanks

Was it helpful?

Solution

Don't use a design tool to create the GUI. Its sounds like Netbeans is using a absolute layout which is not what your want.

Use a proper layout manager. Maybe a FlowLayout that is right aligned.

Read the section from the Swing tutorial on How to Use Flow Layout for more information and working examples.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top