File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Absolute Positioning making doubles Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Absolute Positioning making doubles" Watch "Absolute Positioning making doubles" New topic
Author

Absolute Positioning making doubles

marco costantini
Greenhorn

Joined: May 23, 2009
Posts: 1
Hi all,
I need absolute positioning here and ive set the bounds for a new jlabel and subsequently "add"ed it. it adds it perfectly in the right spot, but additionally draws one at the top centre as if i didnt specify any bounds.

I think it has something to with the repainting. sometimes, it draws only one at the top, sometimes two, sometimes three. and when i resize it perpetually continues to draw more labels.

whats going on? this is all taking place in my overridden paintComponent method which is quite large to paste here.

thanks so much!
marco.

*EDIT* this happens in a loop actually. is that cool?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> whats going on? this is all taking place in my overridden paintComponent method which is quite large to paste here.

if you want a solution (rather than guesses) you'll have to trim it and post it
i.e. get rid of everything unrelated to the problem, then post a trimmed-down compilable program
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Absolute Positioning making doubles
 
Similar Threads
ABSOLUTE LAYOUT/ NULL LAYOUT..
constructing a component (beginner)
Problem using divs.
displaying image embedded in frame on browser
Adding components to BoxLayout dynamically