Results 1 to 5 of 5
  1. #1
    joolske is offline Member
    Join Date
    Dec 2012
    Posts
    6
    Rep Power
    0

    Default Refreshing TextArea

    Hi there!

    I wonder if anyone can help me out. I have to make a code for a certain type of bar, where the prices change everytime someone buys a drink (example: customer buys 3 beers, the prices of all drinks change, 30 seconds later 5 lemonades are sold, prices of all drinks change again). I would like to make a dynamic price list that changes every time after a purchase (or if that isn't possible: that refreshes every 5 seconds (for example)).

    Everytime a purchase has been made, I change the prices in my database and then I execute a query to get the new prices. Normally I would use setText() to show the prices on the screen, but this doesn't work because the GUI where I change the prices is another then the GUI where I have to show them.

    Is there anyone who has a clue what I have got to do?

    Thanks in advance!

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: Refreshing TextArea


  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Refreshing TextArea

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Aash96 is offline Member
    Join Date
    Dec 2012
    Posts
    26
    Rep Power
    0

    Default Re: Refreshing TextArea

    private void Update_table(){

    try{

    ResultSet rs = obj.queryTbl("Prices of drinks SQL will be here");

    while(rs.next())
    {

    cmd_ltable.setModel(DbUtils.resultSetToTableModel( rs));

    }
    }
    catch(Exception e)
    {
    System.out.println(e.getMessage());
    }
    }

  5. #5
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: Refreshing TextArea

    the GUI where I change the prices is another then the GUI where I have to show them.
    Like a different application?

Similar Threads

  1. refreshing
    By willy in forum New To Java
    Replies: 0
    Last Post: 12-04-2011, 10:56 AM
  2. Problem with refreshing
    By misiom1 in forum New To Java
    Replies: 7
    Last Post: 01-15-2011, 12:37 PM
  3. Refreshing JList - need help
    By Unsub in forum New To Java
    Replies: 1
    Last Post: 04-13-2010, 06:31 AM
  4. JTableHeader not refreshing
    By aznboarder in forum AWT / Swing
    Replies: 4
    Last Post: 04-11-2009, 04:31 AM
  5. Bug in refreshing jsp
    By anki1234 in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 12-31-2007, 07:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •