Reputation:
Many programs allow to freely rearrange buttons on gui. For instance Firefox and Chrome have "customize" option. How to do it in Java? Sure, I can bring GUI constrains to settings file and let user edit it, but this isn't user friendly. Is there a better way to do this?
Upvotes: 0
Views: 212
Reputation: 73
You can try creating a preference menu like you find in Chrome etc. This will provide for a familiar and user friendly method to do so. You can also go ahead and allow the use to change icon or size if you want to.
Another way could be that you allow the buttons to be dragable and resizable across a container and using events based on movements of the mouse to reorder the buttons in question.
Upvotes: 2
Reputation: 324118
How to do it in Java?
There is no built in support, so you need to provide this yourself.
Check out the Drop Demo Project
from the Swing tutorial on Drag and Drop. It will show you how to implement the JList so items can be dragged to a new location.
So basically you need to write the code yourself.
Upvotes: 3