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.
My problem is, I want my Jlabel to appear at the 0,0 location, as coded in the grdibagconstraints, but it appears in the center if i run this code. I already read alot of the apis, but it didn't help. Please help. Thanks
Thanks for reply, but when i change the values of
c.gridx = 0;
c.gridy = 0;
it stays at NORTHWEST.
is there a way to change its location according to the x,y?
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
Could be wrong (usually am), but I have a sneaking suspicion you can't just 'place'
components here-and-there in GBL e.g. at 1,1 with no other components.
you may need to add a JPanel at 0,0 then use an appropriate layoutManager
for the panel to add your label where you want it.
Willie Tsang
Greenhorn
Joined: Nov 20, 2011
Posts: 24
posted
0
Thanks alot for your post. Ill confirm that by reading the api, and mean while ill try different layouts. Thanks.