This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Problem in ScrollPane's paint() method 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 ScrollPane Watch "Problem in ScrollPane New topic
Author

Problem in ScrollPane's paint() method

Chandhrasekar Saravanan
Ranch Hand

Joined: Jun 16, 2002
Posts: 57
Hi,
I am trying to write a file in to a ScrollPane, i had given a option that
user uses FileDialog to choose. everything is working fine. but the problem is,
the user has to drag the scrollpane's scrollbar to display the file first.
i dont know why this happens.
i found that ,whenever i chose a file from menubar, the setFile() method
changes the file, but that is not reflected in the paint() method. but when
i drag the scrollbar, the file gets into the paint() method. what shoul i do
so that whenever i choose a file from FileDialog, directly gets into the ScrollPane's
paint() method.
here is my code

Thanks
Sincerely
Chandhrasekar Saravanan
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4165
    
  21

place a repaint() method call at the end of the setFile() method. Maybe this will work.
Steve


Steve
 
Don't get me started about those stupid light bulbs.
 
subject: Problem in ScrollPane's paint() method
 
Similar Threads
problem in paint() method when using ScrollPane
show() and setVisible()
Problem in Menu, from RHE
Reading a file in ScrollPane
how to control components of another window