• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in ScrollPane's paint() method

 
Chandhrasekar Saravanan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
place a repaint() method call at the end of the setFile() method. Maybe this will work.
Steve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic