jQuery in Action, 2nd edition*
The moose likes Swing / AWT / SWT and the fly likes Problem in repaint Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem in repaint" Watch "Problem in repaint" New topic
Author

Problem in repaint

priya gnana
Greenhorn

Joined: Jun 08, 2008
Posts: 14
I want to show some parent-child relationship by drawing rectangles.first,i'll draw all the parent rectangles,on-click of
parent rectangle,child should dispaly.(for all clicked rectangle).I implemented,first by
drawing the all the Parent rectanlges.if any Parent rectangle was clicked,I 'll check whether
it has child,if it has,I have to call the (drawRect(Graphics g) and repaint everything)�But here,the problem
is the screen is not repainting properly..can anyone help me�
[ July 21, 2008: Message edited by: priya g ]
priya gnana
Greenhorn

Joined: Jun 08, 2008
Posts: 14
any help.........
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41015
    
  43
PatienceIsAVirtue. You posted this just 90 minutes ago.

This is a lot of code to go through. You can make it easier for people to help you if you describe in detail what the code is supposed to do, and what it is actually doing. Also, "the screen is not repainting properly" is not a very useful problem description - people here are not going to run the code, so they can't see what's happening.


Ping & DNS - my free Android networking tools app
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

"priya sg",

Please read your private messages regarding an important announcement.

Thank you,

Rob


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
priya gnana
Greenhorn

Joined: Jun 08, 2008
Posts: 14
I'm want to display parent child relationship for some(comes from xml)
first,i'll read and draw only the parent and draw it as rectangle(co-ordinates were decided by me)
then,if i click on the rectangle(which represents the parent)child should display(as in the jtree)
so,when i click on the parent rectangle,below it child rectangle should display and
all other rectangles below it should be adjust so that it 'll not overlay.so for the first time(while the applet loaded)i'll get count of parents and draw rectangles.when any of this rectangle was clicked,its status will be maintained(true for clicked a particular rectangle false for not clicked).in an array and the whole thinghave to be re drawn while redrawing,the status 'll be checked if true,child rectangle 'll be drawn only for the rectangle whose status is true.but,for me for the first click the,its working fine.But for the second click on someother rectangle,its drawing twice and for the third click on some other,nothing is getting changed....I don't know where i went wrong...can you please help me..
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Have you read my previous post?
Sven Goetgeluck
Greenhorn

Joined: Jul 16, 2008
Posts: 14
hi You tried

SwingUtilities.updateComponentTreeUI( the_thing_ u_want_to_repaint );

sven
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in repaint
 
Similar Threads
Drawing in XORMode or Layers?
Drawing at nodes
I need a little guidance
dnd
graphics question: paint(), repaint(), update()