Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Absolute Positioning making doubles  RSS feed

 
marco costantini
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!