I am very new to Java Swing programming and I have a small problem.
When I design a user interface using Jframe and JPanels, JPanel does not allow to drag and drop an item in a place I desire (At design time ). Lets say I add a button to JPanel, then the button is stuck in the middle of the panel and I cannot drag it to a place I desire.This does not happen when I add items directly to the JFrame.
I tried using setBounds(int x, int y, int width, int height) method to move the button in JPanel but it did not work.Following image would describe my problem well. I want to drag the button in the JPanel to the left, just like the button added in the JFrame.
Button in JPanel - Top and JFrame - Bottom:
Is there a way to drag and drop items freely in the JPanel as well?
Thanks.
