Resize « Graphics « Java Swing Q&A





1. How to prevent flickering when resizing a component in swing?    stackoverflow.com

If I run the following example I get flickering in the right side of the JSplitPane. Is there a way to avoid this?

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class FlickerTest
{
  ...

2. PLAF: sideeffect resizing and painting    coderanch.com

Hello i am trying to give another shape (a polygon other than a square) to a JButton by creating another ButtonUI. I am however encountering some problems 1. The fillPolygon(myPolygon) from Graphics does not seem to work when i am trying to paint the new shape. However a drawPolygon(myPolygon) and a fillOval(0, 0, width, height) do work. 2. When the frame ...

3. painting problems when resizing    coderanch.com

These "duplicate" components aren't real components are they? They're just (how can I phrase this well...) "smears" left over from when the real component moved over that area. Right? The "smears" basically come from an "invalid" area that can't be repainted. I can think of two reasons why this would happen. One is performance... something is taking a long time (perhaps ...

4. Flickering on resize    coderanch.com

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 ...

5. avoid calls to paint() on resize?    java-forums.org

Hi, i'm using swing and i've encountered a problem. When my JFrame gets resize the paint method is called (serveral times), the problem is my paint method is quite large and takes times to calculate. I've heard that i could use a BufferedImage to save the "frame" and then paint it again when my Frame has finished resizing (when componentResized() is ...

6. problem with gui , graphics , and resizing    forums.oracle.com