A
asd
Hi all,
I am doing some kind of home work using swing. Unfortunately I am having
problems with setLocation() function. I know it is a bad idea to use
setPosition and I know I should use Layout manager instead of doing that.
Still I would like to do it with setLocation.
Here is my problem: I am trying to position a button on a given pixel on the
screen. To do that I am using setLocation function of the JButton.
Here is what I did:
Created a JFrame,
Created a JPanel, and added it to frame.
Created a JButton, and added it to panel.
Called setLocation function of the button. It is not working. The button is
just created in the center of the window, where layout manager places it.
What should I do to get it work?
I would really appreaciate it if you could help me with my problem.
Sincerely yours.
I am doing some kind of home work using swing. Unfortunately I am having
problems with setLocation() function. I know it is a bad idea to use
setPosition and I know I should use Layout manager instead of doing that.
Still I would like to do it with setLocation.
Here is my problem: I am trying to position a button on a given pixel on the
screen. To do that I am using setLocation function of the JButton.
Here is what I did:
Created a JFrame,
Created a JPanel, and added it to frame.
Created a JButton, and added it to panel.
Called setLocation function of the button. It is not working. The button is
just created in the center of the window, where layout manager places it.
What should I do to get it work?
I would really appreaciate it if you could help me with my problem.
Sincerely yours.