This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Flickering on resize

 
Greenhorn
Posts: 15
Eclipse IDE Slackware Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a program that draws a graph, but for now, all I have done is two lines: the X and Y axis.
The program is designed in a way as to automatically resize the graph when the window is resized.

Is this code in some way extremely inefficient? I get TERRIBLE flickering when I resize the window, and it
really annoys me. Is there any way around this problem, or something that will at least reduce the flickering?
This is important. Any help is greatly appreciated. I will also add that I have a very high-end PC.

mainApp.java:


GraphPanel:


I have added a screenshot that shows the window flickering.
ScreenshotDuringResize.png
[Thumbnail for ScreenshotDuringResize.png]
 
Saloon Keeper
Posts: 11488
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't flicker for me.

As an aside, it's better to add the panel before you show the frame.

Also, don't call your program mainApp, call it MainApp.
 
I don't even know how to spell CIA. But this tiny ad does:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!