Update JFrame including JComboBox

Hello,
Read lots about this stuff, but nothing worked in my case...
Here more about my problem:
In my JFrame , there's a JComboBox which contains several names of people.
I can open a JInternalFrame , where I can add an extra name.
When I close the JInternalFrame, the main JFrame (incl the JComboBox ) has to update, so the extra name is visible...
private class InternalFrameHandler extends InternalFrameAdapter{
        public void internalFrameClosing(InternalFrameEvent e){
                if(e.getSource()==userFrame){
                    updateFrame();
public void updateFrame(){
        this.repaint();
        this.validate();
    }It doesn't works. I've tried also:
- getContentPane().repaint() and then getContentPane().validate();
or
- this.update(getContentPane().getGraphics());
None of this seems to work...
Strange,
Any ideas?
Thank you

Extra class info: ( simplified )
public class GUI extends JFrame{
     private JDesktopPane desktop;
     private JComboBox keuzeGebruiker;
     private JInternalFrame userFrame;
public GUI(String title, int breedte, int hoogte) {
        super(title);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
        this.setResizable(false);
        this.setUndecorated(false);
        this.breedte=breedte;
        this.hoogte=hoogte;
        desktop = new JDesktopPane();
        desktop.setLayout(new BorderLayout(0,0));
        setContentPane(desktop);
        desktop.setBackground(kleur.getBackground());
        keuzeGebruiker = new JComboBox(lijstGebruikers);
        keuzeGebruiker.setSelectedItem(null);
        keuzeGeb = new JPanel();
        keuzeGeb.setLayout(new FlowLayout(1,breedte/80,hoogte/100));
        keuzeGeb.add(keuzeGebruiker);
      desktop.add(logIn,"North");
        addWindowListener(new WindowHandler());
}

Similar Messages

  • How to update the second JComboBox according selection in first JComboBox??

    I am having a hard time to update the second JcomboBox according to the selection of the first JcomboBox. For example, the content of the first JcomboBox is {city, rent}. When "city" is selected, the content of the second JcomboBox should be set to a number of cities. When "rent" is selected, the content of the second JcomboBox should be set to a range of rent.
    Since I have to detect the selection in actionperformed(), where the JcomboBoxes have been added to a Panel, and my JFrame setContentPane() to this Panel, I don't know how to update the JFrame or the Panel. I can make the old JFrame disappear and a new JFrame appear instead, but this is not what I want. I tried method update(Graphics) and removeAll(), and never made it work.
    I would greatly appreciate if anyone could give me any help.

    Thanks for your response. I fixed the problem in the following clumsy way:
    frame.getContentPane().remove(mainPanel);
    mainPanel.remove(box2);
    if(box1.compareTo("city")==0)
    box2 = new JComboBox(cities);
    else if(box1.compareTo("rent")==0)
         box2 = new JComboBox(rents);     
    else if(box1.compareTo("type")==0)
         box2 = new JComboBox(types);
    box2.setBounds(305, 30, 90, 20);
    mainPanel.add(box2);
    frame.getContentPane().add(mainPanel);
    Maybe there is a better way, but I don't know, and I don't understand your suggestion, could you further explain it? Thanks a lot.
    lz22

  • I'm running OS 10.7.5 and I'm missing  my contacts, mail, and update capabilities, including itunes store How do I re-install them?

    I'm running OS 10.7.5 and I'm missing  my contacts, mail, and update capabilities, including itunes store How do I re-install them?

    Are you logged into your Admin. Account or to a Guest Account that does not have access to the things your missing?

  • [svn] 3777: Bug fix SDK-17677 Update to include MPL license and third-party notices.

    Revision: 3777
    Author: [email protected]
    Date: 2008-10-21 10:20:27 -0700 (Tue, 21 Oct 2008)
    Log Message:
    Bug fix SDK-17677 Update to include MPL license and third-party notices.
    QE Notes:
    Doc Notes:
    Bugs: SDK-17677
    Reviewer: Matt Chotin
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17677
    http://bugs.adobe.com/jira/browse/SDK-17677
    Modified Paths:
    flex/sdk/trunk/modules/webtier/readme.txt

    Step by step, how did you arrive at seeing this agreement?

  • Forgot whether automatic updates are included when you update Flashplayer.  Update was fine, just didn't see where to click to get automatic updates.

    Forgot whether automatic updates are included when you update Flashplayer.  Update was fine, just didn't see where to click to get automatic updates.  Please advise whether I need to do anything or not.  Thanks.

    If you are using Windows:
    You must be logged in from an Administrator account not a Standard account.
    Click on START, then Click on CONTROL PANEL, then be sure the View is set to Large Icons not Category.
    Click on the Flash Player Icon. The Flash Player Control Panel should come up.
    Click on the UPDATES tab. Now you can verify or select automatic updating.

  • HT1338 When I press the iTunes update, everything including my mails were stuck up n ask to go to security link, pls advise n help

    When I press the iTunes update, everything including my mails were stuck up

    Hi
    Level 2 posters and Above can report various posts.
    When they do so they have various options that they can attribute as the issue.
    I have reported your post.
    I found the one block of text very difficult to read.
    9:36 PM      Monday; January 28, 2013
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Just got a Canon G7 x only to find that lightroom 5 and PS6 don't support the camera RAW that it produces. Tried the Camera raw 8.7 and that didn't help. Will there be an update that includes this camera?

    Just got a Canon G7 x only to find that lightroom 5 and PS6 don't support the camera RAW that it produces. Tried the Camera raw 8.7 and that didn't help. Will there be an update that includes this camera?

    I'm sure there will be support for the camera eventually. But Adobe never announces that information in advance. It's possible that it could be added to the 8.7 final release and to the next update of Lightroom. But that depends on the timeline and if the engineers were able to get the camera in time to create profiles. You'll just have to wait and see.

  • In 7u51, will all jars referenced by the applet need to be updated to include the Permissions Manifest attribute ? Or, will it be limited to the jar that contains the applet code ?

    To whom it may concern,
    According to Java RIA checklist(http://www.oracle.com/technetwork/java/javase/overview/ria-checklist-2055184.html),
    as of 7u51(January 2014), Permissions Manifest attribute in main JAR file will be required.
    But, at least, as of 7u45, when the Security Level slider is set to Very High,
    a jar without Permissions Manifest attribute, which doesn't contain the applet code but is just referenced by the applet,
    prevent the applet from running.
    So, the question is:
    In 7u51, does it mean that all jars referenced by the applet need to be updated to include the Permissions Manifest attribute ?
    Or will it be limited to the jar that contains the applet code?
    There is a concern that we will have to modify library jars that we do not control.
    Sincerely,
    Toshio Shiko

    Thank you for your quick response and your investigation!
    It do help us very much.
    But, unfortunately, for the moment, I'm not allowed to test the early access version.
    As soon as circumstances are changed, I' d like to test it.
    Again, thank you for your providing of the useful information.

  • Updating JFrame content

    I'm developing a Poker game.
    I have done the GUI for the table, card, etc...
    But now I don't really know how/where to put things like
    - Request the system to deal cards
    - Update the table GUI after each time a turn is dealt (hole cards, flop, turn, river, showdown)
    My table GUI is in this form, I don't put my TableGUI code up here as it is too long.
    TableGUI {
    //Set up the table, display the table and actions panel (check, fold, bet, etc..)
    actionPerformed{
       private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
             TableGUI frame = new TableGUI();
       public static void main(String[] args) {
             //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
          javax.swing.SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                 createAndShowGUI();
    }Could some one tell me how/where to put those above?
    Thanks

    for changing cards here's a simple demo
    I used these 2 images (from google) - download/use at your own risk
    http://www.markhope.com/imagebank/poker/cards/aceofclubs.gif
    http://www.markhope.com/imagebank/poker/cards/aceofdiamonds.gif
    click the button to change the card - you would also have a cardback.gif - for face down
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      JLabel card = new JLabel(new ImageIcon("aceofclubs.gif"));
      public void buildGUI()
        JPanel p = new JPanel(new GridBagLayout());
        p.add(card,new GridBagConstraints());
        JButton btn = new JButton("Next Card");
        JFrame f = new JFrame();
        f.getContentPane().add(p,BorderLayout.CENTER);
        f.getContentPane().add(btn,BorderLayout.SOUTH);
        f.setSize(600,400);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        btn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            card.setIcon(new ImageIcon("aceofdiamonds.gif"));
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }for the betting I would image it would be set up to have the options in a popup,
    or dialog, and then
    actionPerformed(..) {
      if (e.getSource() == raise) {
        user.money() = user.money() - raiseAmount;
        computerTurn();
      else if (e.getSource() == call) {
        user.money() = user.money() - callAmount;
        determineWinner();
      else if(e.getSource() == fold){
        newGame();//which would include dealCards()
    }

  • Update JFrame via another Thread

    Hello,
    I have a JFrame with a JProgressBar, and I need to see the JProgressBar fill as some operation executes. In that JFrame there's a public method that increments the JProgressBar. This serves as a GUI to another class. That other class receives, as an argument, the JFrame, in order to be able to call that public method to increment the JProgressBar.
    Something like:
    public class Worker{
       public Worker(JFrame jf){
          this.frame = jf;
       public doWork(){
          instruction1;
          frame.updateProgressBar();
          instruction2;
          frame.updateProgressBar();
    }This has a major problem: the JFrame's graphics won't be updated (you won't see the progress bar filling during the operation). So I made a class to run the Worker on a Thread, that looks something like:
    public class WorkerThread extends Thread{
       public WorkerThread (Worker w){
          this.worker= w;
       public void run(){
          w.doWork();    
    }This got the problem solved, the JProgressBar is now correctly updated. But it created a new problem: I need the JFrame to wait for the WorkerThread to finish, and that's what I'm having real trouble with:
    public class GUI extends JFrame{
       private worker = new Worker();
       void someButtonPressed(...){
          WorkerThread wt = new WorkerThread(worker);
          wt.start();
          System.out.println("I don't want to see this until the Thread finishes");
    }If I leave this as is, I'll see the text before the Thread finishes.
    So I added "wait()" between the last two instructions, and a "notify()" as the last instruction of the run() method on WorkerThread. Unfortunately, this gives me two exceptions (java.lang.IllegalMonitorStateException: current thread not owner), one when I call wait() and another when I call notify(). If I make the two methods that call wait() and notify() synchronized, the JFrame's graphics won't update correctly (back to the initial problem).
    Any suggestions? Sorry for the long post, and thanx in advance! :)

    I don't really understand why you are using two JFrames.
    Typically in an application you have a single main JFrame. Whenever you need additional information you would create and display a "modal" JDialog. A modal JDialog prevents the JFrame from receiving any events. So in your example the progress bar should be added the dialog. When the long running task is finished you close the dialog an execution continues back in your main JFrame.

  • Track table data changes (inserts, updates, deletes) including os_user

    Hi ,
    I was given a task by manager to keep track of changes on a given table including os_user who made it.
    Should I create a trigger on it (on any update, insert, delete etc.) or there is a better way of doing it ?
    I think there could be some info already in some data dictionary views or something like it.
    If I CREATE MATERIALIZED VIEW LOG on that table would it help?
    I'm kind of new to that sort of tasks,
    Thanks a lot!

    Leo_Y wrote:
    Hi ,
    I was given a task by manager to keep track of changes on a given table including os_user who made it.
    Should I create a trigger on it (on any update, insert, delete etc.) or there is a better way of doing it ?
    I think there could be some info already in some data dictionary views or something like it.
    If I CREATE MATERIALIZED VIEW LOG on that table would it help?
    I'm kind of new to that sort of tasks,
    Thanks a lot!is application 3-tier like below?
    EndUser<=>browser<=>WebServer<=>ApplicationServer<=>DatabaseServer

  • I would like to make a suggestion for the next iso iphone 4-4s update.  Include a seperate treble and bass switch. What do u people out there think about this

    I would like to make a suggestion for the next iso itunes software update for the iphone 4-4s.  Include a serperate treble and bass switch for the ipod on the iphone.  What to you people out there think about this?

    vince20 wrote:
    Obviously you dont like listening to music on your ipod in iphone.  The EQ is crap
    Not true at all.
    I listen to music on my iphone all the time.
    It is your position that anyone who does not agree with you does not listen to music?
    Really?
    What a leap.

  • How to manually uninstall Java EE 5 Update 8 including Glassfish service

    Hi,
    Sorry if this is covered elsewhere, but I've done some searching and can't find it.
    I have Windows 7 professional, and I installed the Java EE SDK 5 update 8 which includes Glassfish 2.1.1 onto my system. Due to multitasking during installation (aka not paying enough attention) it installed in a really weird place ({MyUser}\AppData\Local\Temp\java_ee_sdk-5_08-jdk-6u17-windows.exe2) and I want to uninstall it and reinstall. However I cannot find an uninstall anywhere. Has anyone any ideas on how I can do this or know where the install extracts to before running so I can see if I can find it there?
    Any suggestions gratefully received!
    Thanks,
    Caroline

    After a lot more work, the "repeated-every-10-seconds" messages seem to be gone now.
    To review, I already deleted these folders and files:
         /Library/Application Support/DriveGenius
         /Applications/Drive Genius 3.app
         /Users/Library/Application Support/DriveGenius
         /Users/Library/Preferences/com.prosofteng.DriveGenius2.plist
         /Users/Library/Preferences/com.prosofteng.DGAgent.plist
    I found this file and tried to remove it:
         /Users/jimp/Library/LaunchAgents/com.prosofteng.DGMonitor.plist
    Dragging the file to the trash did not work. Trying to remove the file via the Terminal "rm" command did not work. Even doing
    "sudo rm com.prosofteng.DGMonitor.plist" would not work, resulting in the message:
    "rm: com.prosofteng.DGMonitor.plist: Operation not permitted" and the file was still there.
    I used COMMAND-I to change the file permission to READ AND WRITE and then used the VI editor in Terminal to "comment out" every line of the file by adding a "#" at the start of each line. Then I wrote out the file.
    I still could not remove the file---I don't know why--- but I suppose it is now inert and can't do anything.
    Upon restarting, the Console log no longer shows those "every-10-seconds" errors.
    I assume my problem is solved?
    I have yet to determine whether the Mac Pro will go to sleep as it used to do.
    Now I need to remember to NEVER TRY INSTALLING DRIVE GENIUS or other dangerous applications again.
    I hope these notes are of some value to other Mac 10.6.8 users out there.

  • How to update  data including '@' charecter.

    Hi All,
    i am running this update script as .sql from command prompt (windows). but i am getting .....error like...Unknown command -
    SP2-0734: unknown command beginning "Customer: ..." - rest of line ignored.
    SP2-0734: unknown command beginning "Offer Numb..." - rest of line ignored.
    SP2-0734: unknown command beginning "\@aresp_li..." - rest of line ignored.
    SP2-0734: unknown command beginning "Country: \..." - rest of line ignored.
    SP2-0044: For a list of known commands enter HELP
    and to leave enter EXIT.
    the script is as follows......update.sql
    UPDATE EMAIL
    SET
    EMAIL_SUBJECT='Document Awaiting Your Approval: @appr_document_no - @prop_num - @cust_name',
    EMAIL_BODY='Click on the link below to view and approve the document.
    Customer: @cust_name
    Offer Number: @prop_num
    @aresp_link
    Country: @country_id' WHERE EMAIL_ID='1234';
    please guide me how to update this data including '@' charecter.
    Thanks in Advance.

    user9041629 wrote:
    Hi All,
    i am running this update script as .sql from command prompt (windows). but i am getting .....error like...Unknown command -
    SP2-0734: unknown command beginning "Customer: ..." - rest of line ignored.
    SP2-0734: unknown command beginning "Offer Numb..." - rest of line ignored.
    SP2-0734: unknown command beginning "\@aresp_li..." - rest of line ignored.
    SP2-0734: unknown command beginning "Country: \..." - rest of line ignored.
    SP2-0044: For a list of known commands enter HELP
    and to leave enter EXIT.
    the script is as follows......update.sql
    UPDATE EMAIL
    SET
    EMAIL_SUBJECT='Document Awaiting Your Approval: @appr_document_no - @prop_num - @cust_name',
    EMAIL_BODY='Click on the link below to view and approve the document.
    Customer: @cust_name
    Offer Number: @prop_num
    @aresp_link
    Country: @country_id' WHERE EMAIL_ID='1234';
    please guide me how to update this data including '@' charecter.
    Thanks in Advance.post top 20 or so line from file

  • Updating JFrame with creating a new one

    Hi All,
    I instantiate an object as follows, which creates a JFrame
    _imageOutput = new ImageOutput(array, offsetArray);
    however this is inside a loop and instead of updating the JFrame is creates a new one each time. How can I stop it from creating a new one each time?
    Thanks,
    Enda.

    How can I stop it from creating a new one each time?If you do
    _imageOutput = new ImageOutput(array, offsetArray);
    then OF COURSE it creates a NEW ImageOutput object.
    If you want to update it (whatever that mean) then add a new method in that object like Update(). Then everytime you want to update it, use
    _imageOutput.Update() .  You can refresh the graphics of a JComponent with repaint().                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Installation stuck at Create database schema Phase 13 of 27

    Hi I am installing the Netweaver 7.01 SP3 and have already removed it completely after getting stuck at the same installation step. Do not know what is going wrong. A small extract of the log is shown below. Any advice on how to proceed will be helpf

  • Can I use a formula node to start the execution of a case structure?

    Hi, I am working on editing a VI to make it much easier to understand (for colleagues and non LV users). For one reason or another, the VI's creators did not fully make use of the power of case structures and other structure types. In the application

  • DNG Problem in Aperture 3.0.1

    Just upgraded to Aperture 3.0.1 right after installing the 3.0 upgrade (I have been using 2.1.4 for some time). Am trying to convert RW2 RAW files to DNG. I use the latest Adobe RAW converter (5.6), but although Aperture can read the RW2 files, it ca

  • How to turn ON Spotlight in Terminal?

    I recently upgraded my Dual 1.8 G5 to Tiger, and followed lots of advice to turn off Spotlight. I did this via the Terminal. well, ive decided that i want it back on, but i dont have the directions to turn it back on, only off via the Terminal. I am

  • Best way to store historical data

    Hello: I'm currently developing an application that monitors some phisycal variables such as temperature and differential pressure in different locations. I also must do historical datalogging of the values read so the user can generate reports of th