• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

refresh data on a GUI from another GUI

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I got 2 frames, the first frame has text fields and combo boxes displaying a data record and the second frame let user choose a data record from a combo box to be displayed on the first frame. Both use data from a shared record object. If a user click on a button on the first frame, the second frame pops up and let user choose a new record. After clicking on a button on the second frame, the new data record displays on the first frame. My problem is to make the new data record displayed on the first frame. I make the first frame a member, and pass it as object to the second frame. Then I call the functions created in the first frame on the passed object to populate the displaying fields with data from new record, but somehow nothing were displayed. What did I do wrong? What are the alternatives? Please help. Thank you very much.
--newbie
 
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like you have the right idea. One thing you might need to do is explicitly trigger a redraw of the first frame. You can do that bu triggering another JFrame.pack(), or maybe by using JFrame.revalidate();

Originally posted by tom nugent:
Hello,
I got 2 frames, the first frame has text fields and combo boxes displaying a data record and the second frame let user choose a data record from a combo box to be displayed on the first frame. Both use data from a shared record object. If a user click on a button on the first frame, the second frame pops up and let user choose a new record. After clicking on a button on the second frame, the new data record displays on the first frame. My problem is to make the new data record displayed on the first frame. I make the first frame a member, and pass it as object to the second frame. Then I call the functions created in the first frame on the passed object to populate the displaying fields with data from new record, but somehow nothing were displayed. What did I do wrong? What are the alternatives? Please help. Thank you very much.
--newbie


 
reply
    Bookmark Topic Watch Topic
  • New Topic