This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have background picture and a label that is suppose to go on top of it but i can't seem to control it's location.
Setting the location seems to have no effect. I tried increasing the numbers but the textLabel won't budge. It's not exactly at (0,0) of the panel.
It is actual 1/4 to the right and less than 1 row down.
You need to read the Sun tutorials on the layout managers to understand what is happening and why. For one, the container you are placing your label in is using a layout manager, possibly FlowLayout as a default layout, and so setLocation won't work. setLocation works when using a null layout, but having said that I don't recommend that you use this, but instead learn to use and nest the various layout managers.
I will request that the mods move this question to the Swing forum.
all you seem to be doing is copying working code (latest from this forums FAQ),
adding stuff, then posting it here with a 'this doesn't work'.
the changes you make indicate very little understanding of the basics of swing,
so I'd suggest you start the tutorials earlier than the layout managers.
Hi Ana,
I have a great LINK to learn java swing... It show you how to use layout manager and etc..
Just sit back, make some coffee (java coffee ) and check out the link..Have a nice study..
At the center of non-violence stands the principle of love
.... Martin Luther King, Jr.
Ana Suvari wrote:I have background picture and a label that is suppose to go on top of it but i can't seem to control it's location.
Setting the location seems to have no effect. I tried increasing the numbers but the textLabel won't budge. It's not exactly at (0,0) of the panel.
It is actual 1/4 to the right and less than 1 row down.
This is a good candidate for a custom painting. Extends the JLabel and overide the painComponent method