java - Custom Drawn Component Not Drawing Inside JScrollPane -


I was using Java JRE 1.6.7 and had a JCM apprent and a JScroll. I could not get double buffering to work on that which was always the result of a flicker. If I use canvas, then buffering has to be cared for, but it has to face when used in conjunction with JScrollPan.

So I hope to download JR 1.6.18 that one of these problems OK that JComponent inside JScrollPane is not coming exactly at all. It only pulls out the area outside of JComponent, as if the JSolPan is pulling it upwards except the boundaries.

Here is an example of a code which is not drawing..It is a 1-pixel wide area of ​​area where the drawing should be:

  public zero color ( Graphics arg0) {Graphics2D graphics = (Graphics2D) arg0; Graphics.setColor (Color.WHITE); Graphics.fillRect (0, 0, (int) getWidth (), (int) getHeight ());  

Any help is greatly appreciated! Try to make override with paintComponent (graphics g) instead of

Colors (Graphics G) . Paint is a common method that you have to override for costume drawing.

Are you sure you can see white rectangle, try red or something else that you can see good.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -