This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

telling jlabel ignore application repaint  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,


I am hoping you can help me with what I am trying to achieve. I would like to tell a JLabel or subclass thereof not to repaint when the application calls the repaint method. I know you can use setIgnoreRepaint(true); but that only works for OS level calls not from within the application.

Thank you in advance,
Ben
 
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to explain your requirement better and let us know the reasoning behind it.

What happens if you override repaint() to be a no-op?
 
Ben Burt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thanks for the reply. I can't believe I didn't try that and I was looking at this the completely wrong way! The panel I was adding got repainted OVER the top of the rest and because I didn't set up the sizes properly it paints on top. Sorry for being so daft!
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you need to learn how to use layout managers.
http://download.oracle.com/javase/tutorial/uiswing/layout/index.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!