Creating GUI + EventQueue.invokeAndWait problem

Hi,
Currently I am creating GUI to my application ,thanks to NetBeans Graphic Editor ,I created simple grame with one buton.Now i am trying to add action to this button listener.Generally i want to make that if this button is pressed,new frame with game itself is opening.Firstly I tried with following code:
  java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                a = new NewJFrame1();
                       a.setVisible(true);
        });Everything seemed to be fine apart form the fact that when the new frame has opened,key listenesr in this new game frame weren't working.I read a liitle and I decided to modify my code a bit:
  java.awt.EventQueue.invokeAndWait(new Runnable() {
            public void run() {
                a = new NewJFrame1();
                       a.setVisible(true);
        });Unfortunately I got error message from complier:
ava:154: unreported exception java.lang.InterruptedException; must be caught or declared to be thrown
java.awt.EventQueue.invokeAndWait(new Runnable() {
I thought that i need to add try block with catching InterruptedException but still doesn't work.
Please help my please.I would be grateful if someone could correct this short code so it is working propoerly

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) throws InterruptedException {
       try{ 
        java.awt.EventQueue.invokeAndWait(new Runnable() {
            public void run() {
        //     try{
                 new ramka().setVisible(true);
                    //  if(a.isVisible()==false){b.setVisible(false);}
      //        catch(InterruptedException e){}
       catch(InterruptedException e){}
}

Similar Messages

  • Specifying Event Queue for EventQueue.invokeAndWait().

    Javadoc says EventQueue.invokeAndWait(Runnable runnable) / invokeLater are static methods causing the Runnable executed in the system event queue thread. But I found that my applet appli. running under IE has 3 event dispatching threads AWT-EventQueue-0, AWT-EventQueue-1 and AWT-EventQueue-2. The system event queue (the one returned by Toolkit.getSystemEventQueue() ) is inside AWT-EventQueue-0 but by testing my applet's event queue should be in AWT-EventQueue-2.
    My question is, is it possible to specify which event queue's thread to run the Runnable? Since I found that the 3 event dispatching threads are of different thread groups and only the AWT-EventQueue-2 is in the same thread group as my applet and I want my Runnable to be in the same thread group of my applet thread. The thread groups of the 3 dispatching threads are :
        Thread[] threads=new Thread[100];
        int threadsReturned=Thread.enumerate(threads);
        for (int i=0; i<threadsReturned ; i++) {
            System.out.println("thread name:" + threads);
    System.out.println("thread group class name:" + threads[i].getThreadGroup().getClass().getName()) ;
    System.out.println("thread group name:" + threads[i].getThreadGroup().getName());
    1.
    thread name:Thread[AWT-EventQueue-0,6,main]
    thread group class name:java.lang.ThreadGroup
    thread group name:main
    2.
    thread name:Thread[AWT-EventQueue-1,6,Plugin Thread Group]
    thread group class name:java.lang.ThreadGroup
    thread group name:Plugin Thread Group
    3.
    thread name:Thread[AWT-EventQueue-2,4,http://(my url)/-threadGroup]
    thread group class name:sun.plugin2.applet.Applet2ThreadGroup
    thread group name:http://(my url)/-threadGroup                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Please continue in [the thread where you first posted this problem|http://forums.sun.com/thread.jspa?threadID=5431496]. I'm locking this.
    db
    edit Thread unlocked on clarification from OP in the other thread.
    Edited by: DarrylBurke

  • Creating GUI using a wizard

    Hi,
    I'm new to swing and until now have created GUI using MFC.
    Are there any wizard like tools, that help creating the UI while generating the adaquate code for me?
    Thanks.

    U can use JBuilder /NetBeans / Forte4 etc ..
    Lot of tools are available . u download and create GUI ...
    all the best !!

  • Creating GUI status

    Hi
    I am creating gui status in a function group from se80
    I created same menu in two different gui statuses.
    I want different fields in the menu.
    I have 'goto' menu in first and second gui status.
    I want different fields in the 'goto' menu in both gui statuses
    when i change the fields of the menu in one gui status it automatically changes in the second guistatus
    kindly help me,
    thanks

    Hi,
    Try this..
    Delete the second gui status...
    Then create the second gui status by not copying...
    add the menu and function codes one by one...and then when you enter the same menu..it will ask whether do you want to copy the existing menu or create new menu....here say create new menu....It should work..
    Thanks
    Naren

  • Creating GUI's for simulators.

    Hey all,
    I am VERY new to Java. Can anyone point me in a direction to get more information on creating GUI's for simulators?
    Thanks in advance.

    Encephalopathic wrote:
    overrule wrote:
    Would your advice be extended to Jesus? I mean that he learn how to crawl before he tried to walk on water?I haven't learned that prog language.It's more about IQ isn't it, but okay, I'll give it to you in easily understandable terms - if you're dumb shut up.

  • Noob creating GUI - The easy way?

    I remember in Visual Basic it was so easy creating GUI, just point and click, drag, etc. Is there any similar utility for creating GUI for java?

    It's worth pointing out that 'click-and-drag' isn't the best way. In Java, components may vary in size between platforms. Even in Swing, components sometimes change slightly in size between releases.
    You should take the time to learn how to use the layout managers - it will pay dividends in the long run. I would strongly recommend against using JBuilder's GUI builder until you know how to do it properly by hand. I use JBuilder to assist in building complicated GUIs, but if you don't understand the fundamentals behind the layout managers, the results are likely to be erratic and frustrating.

  • Telnet GUI client giving problems for one userid.

    Hi,
    I have written a GUI program to get userid and password to connect to a Telnet session. The purpose of the program is just to check if the user is a valid user and start another application if the user is a valid user. This application works well and is installed for manay users at my work place. But, this program doesn't work well only for one user. That user tried to use this program by changing is password. He tried to login using this GUI in other terminals. Only this user is having problems logging in in any terminal. But, he is able to open a telnet session without any problems if he doesn't use the GUI. I tried to print the characters that are returned by the server. But, it prints all the characters without any problem. The application hangs at the point, when it has to read the $ prompt after logging in. I also, checked if this user has been set with any other properties for his userid than other users. But, he is having the same privelages like all other users.
    Any help in fixing this problem is appreciated.
    Thanks in advance.

    You need to be more specific about what your program does, for us to suggest some troubleshooting techniques.
    One possibility:
    Your program takes the user's id and password, and if it can authenticate the user, it launches the telnet program (at which point, your user needs to authenticate himself again at telnet's login prompt. In other words, your program provides access to telnet.
    If that is the case, then your user may have changed his password on the remote host, but neglected to change his password on the GUI. I doubt this is the case, but the point I wanted to make is perhaps your GUI is having problems authenticating the user.
    Check to make sure the string the user typed matches the string you have on file. (See below for more on this.)
    The other possibility is:
    Your GUI takes the user's id and password, launches a telnet session, and tries to log in the user via proxy. If it works, the telnet session
    is returned back to the user. If it fails, an appropriate error message is returned. Your program is essentially a front end to telnet.
    If that is the case, then you're likely to have a problem transmitting the password string. Perhaps the user's new password has a character Java and telnet interpret differently.
    First thing to check is literally have your GUI output the string to the telnet session. Don't ask the user to type it in, just ask him what it is. If the password is "fido" (hypothetically), then have your GUI do the equivalent of out.write( "fido" );
    If it bombs, you know you can't transmit that particular string, and the short term solution is to change the password again. If it works, have the user type in the password, but instead of sending it to telnet, just system.out.println( inputtedPassword ); instead. See if Java does any unintentional formatting when reading it in.
    In other words, treat input and output as two seperate cases, and test accordingly.
    When you think about it, that particular password is the key. In fact, if you told us what the password is (don't tell us who you are or where you're connecting from), some Java Guru might see it and say "Oh, you can't do a double backslash like that!"
    Anyways, I'm sure you've solved the problem, I just posted this explaination for the benefit of others who are curious about how to troubleshoot something like this.

  • I am surprised to see that Remote Desktop Client update 3.7.1 been updated without my authorisation and creating now lot of problems from December 7, 2013, any one can tell, how?

    Remote Desktop Client update 3.7.1 has been updated without any permission and now creating umpteen number of problems since December 7, 2013. Now my gmail is empty and unable to see any email.  Most of the time my local host is: 92.242.132.27, I do not know why?
    Now I want to uninstall my update 3.7.1.
    I seek help to resolve my problem.
    Traceroute has started...
    traceroute to www.localhost.com (92.242.132.27), 64 hops max, 72 byte packets 1  192.168.1.1 (192.168.1.1)  1.554 ms  0.995 ms  0.972 ms 2  abts-tn-dynamic-001.0.164.122.airtelbroadband.in (122.164.0.1)  28.460 ms 3  abts-tn-static-093.227.95.61.airtelbroadband.in (61.95.227.93)  27.732 ms 4  61.95.240.129 (61.95.240.129)  27.433 ms  28.015 ms  27.758 ms
    5  59.145.7.133 (59.145.7.133)  187.777 ms  186.806 ms  236.866 ms 6  182.79.243.18 (182.79.243.18)  179.356 ms  179.188 ms  178.033 ms 7  182.79.248.234 (182.79.248.234)  178.512 ms  179.033 ms  179.084 ms 8  aes-static-029.37.144.59.airtel.in (59.144.37.29)  178.879 ms  177.540 ms 9  xe-0-0-0-0.edge00.thn.uk.hso-group.net (195.66.224.226)  177.235 ms  178.6
    10  xe-0-0-0.edge00.the.uk.hso-group.net (93.89.91.13)  177.571 ms  177.667 ms 11  ert1-the-gi1-8.router.uk.catalyst2.net (93.89.90.10)  187.420 ms  185.670 12  84.18.192.130 (84.18.192.130)  178.729 ms  178.521 ms  178.316 ms 13  * * *
    14  * * * 15  * * * 16  * * * 17  * * * 18  * * * 19  * * * 20  * * * 21  * * * 22  * * * 23  * * * 24  * * *

    Remote Desktop Client update 3.7.1 has been updated without any permission and now creating umpteen number of problems since December 7, 2013. Now my gmail is empty and unable to see any email.  Most of the time my local host is: 92.242.132.27, I do not know why?
    Now I want to uninstall my update 3.7.1.
    I seek help to resolve my problem.
    Traceroute has started...
    traceroute to www.localhost.com (92.242.132.27), 64 hops max, 72 byte packets 1  192.168.1.1 (192.168.1.1)  1.554 ms  0.995 ms  0.972 ms 2  abts-tn-dynamic-001.0.164.122.airtelbroadband.in (122.164.0.1)  28.460 ms 3  abts-tn-static-093.227.95.61.airtelbroadband.in (61.95.227.93)  27.732 ms 4  61.95.240.129 (61.95.240.129)  27.433 ms  28.015 ms  27.758 ms
    5  59.145.7.133 (59.145.7.133)  187.777 ms  186.806 ms  236.866 ms 6  182.79.243.18 (182.79.243.18)  179.356 ms  179.188 ms  178.033 ms 7  182.79.248.234 (182.79.248.234)  178.512 ms  179.033 ms  179.084 ms 8  aes-static-029.37.144.59.airtel.in (59.144.37.29)  178.879 ms  177.540 ms 9  xe-0-0-0-0.edge00.thn.uk.hso-group.net (195.66.224.226)  177.235 ms  178.6
    10  xe-0-0-0.edge00.the.uk.hso-group.net (93.89.91.13)  177.571 ms  177.667 ms 11  ert1-the-gi1-8.router.uk.catalyst2.net (93.89.90.10)  187.420 ms  185.670 12  84.18.192.130 (84.18.192.130)  178.729 ms  178.521 ms  178.316 ms 13  * * *
    14  * * * 15  * * * 16  * * * 17  * * * 18  * * * 19  * * * 20  * * * 21  * * * 22  * * * 23  * * * 24  * * *

  • Error creating GUI for dmardemo.java

    Hi friends!
    I took the demo dmardemo.java (Association Rules) which comes with the ODM for Java to test Data Mining function in the sample database Sales History. In the original code, the application ran normally. However, I'm trying to create a GUI to execute the most important funcionalities like creating view, preparing and building model and restoring rules and itemsets. I created a visual class in the same project where the demo is. I've done some changes in the methods, like putting some input parameters for them. e.g.:
    [i]public static void buildModel(String viewModelo, String configTask, String modelName, String taskName) throws JDMException
    Connecting is ok. However I can not create the view.. When I execute this method for creating the view, some erros occurs, like:
    Create build data view...
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:840)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:759)
         at project1.dmardemo.createBuildData(dmardemo.java:277)
         at project1.Principal.jMenuItem1ActionPerformed(Principal.java:181)
         at project1.Principal$7.actionPerformed(Principal.java:110)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1170)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1211)
         at java.awt.Component.processMouseEvent(Component.java:6038)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
         at java.awt.Component.processEvent(Component.java:5803)
         at java.awt.Container.processEvent(Container.java:2058)
         at java.awt.Component.dispatchEventImpl(Component.java:4410)
         at java.awt.Container.dispatchEventImpl(Container.java:2116)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
         at java.awt.Container.dispatchEventImpl(Container.java:2102)
         at java.awt.Window.dispatchEventImpl(Window.java:2429)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    What could be happening?
    Thanks!!
    Regards
    Luis

    I have to tell you that the problem was occurring because of the clean() method. It must clean all views created before, and I was ignoring its execution. Now, another thing is happening: every time I made a call for it, an exception occurs, telling me that I must pass an input parameter for this method, and a null value for the objectName is not allowed.
    However, this method doesn't work with any parameters.
    What could be happening?
    Thanks a lot!
    Luis

  • Created GUI using Matisse, can't get text on jPanel

    Hello, I am tying to build my first desktop application. I created a test GUI using Netbeans Matisse.
    When the button is pressed I want that the text string stored in the variable text appears on jPanel1. The String is retrieved from a database (that's not a problem).
    How to get the text onto jPanel1?
    Here's the GUI code:
    package prototype4;
    import java.awt.Color;
    import spin.Spin;
    public class newGUI extends javax.swing.JFrame {
        /** Creates new form newGUI */
        public newGUI() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            rolloverProducer1 = new org.jdesktop.swingx.RolloverProducer();
            jPanel1 = new javax.swing.JPanel();
            jPanel2 = new javax.swing.JPanel();
            jButton1 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 376, Short.MAX_VALUE)
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 127, Short.MAX_VALUE)
            jButton1.setText("Start");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
            jPanel2.setLayout(jPanel2Layout);
            jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel2Layout.createSequentialGroup()
                    .add(140, 140, 140)
                    .add(jButton1)
                    .addContainerGap(173, Short.MAX_VALUE))
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
                    .addContainerGap(39, Short.MAX_VALUE)
                    .add(jButton1)
                    .add(36, 36, 36))
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap())
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(55, Short.MAX_VALUE))
            pack();
        }// </editor-fold>                       
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        // spin off   
            DAOUser daouser = (DAOUser) Spin.off(new DAOUserImpl());
            String text = daouser.getString();
            System.out.println(text);
            //jPanel1.
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new newGUI().setVisible(true);
        // Variables declaration - do not modify                    
        private javax.swing.JButton jButton1;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        private org.jdesktop.swingx.RolloverProducer rolloverProducer1;
        // End of variables declaration                  
        }

    The code you posted is basically of no use to use since it uses custom Matisse classes.
    Learn how to write a Swing app without a GUI builder. Learn how to use Layout Managers on your own.
    If you want to display text on a panel then you would do:
    panel.add( label );
    panel.revalidate();
    Whos know what will happen with your code because I have no idea what the Matisse Layout Managers do.
    Read the Swing tutorial on [url
    http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Layout Managers.

  • How to load an image without a gui? big problems...

    Hey guys, I usually try my best to not ask for help and figure stuff out myself. But this last week i've been having big problems with this work project.
    My goal is to load images from disk, and append them to each other to create one big image.
    The images are 0-9.jpg each file containing a number in it. then i create one big file with 4 numbers in it. called final.jpg.
    so far i can do all this, but whenever the program is finished, the application just keeps running. the program has literally gone through all the steps... i have a system.out.println printed on the last line after the main, after the class instantiation... and still it stays running.
    how do you guys load images without a gui? This program will probably be running under unix, so i can't create a (for component example)
    Panel() and media track the file load... so i'm pretty much stumped
    any help you guys can provide would be really incredibly helpfull at this point. I have searched these threads for a few hours without luck. I found only 1 real post related to my problem, but eventually they said use MediaTracker = new Mediatracker( new Panel() ); which i can't use. :(
    Thanks a lot guys.
    :D

    yeah tried doing that, didn't work either.
    UPDATE
    I FINALLY found a way...
    and here it is for others to find!
    public BufferedImage getImage(String filename) throws Exception {
    FileInputStream input = new FileInputStream( filename );
    JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder( input );
    BufferedImage image = decoder.decodeAsBufferedImage();
    return image;
    it returns an image buffer, but it's better than nothing! :)
    atleast this functions under unix.

  • Transaction iView - SAP GUI for HTML - Problem while hiding menu bar

    Hello all,
    I am trying to hide the OKcode field and the Menu button in a Transaction iView of type SAP GUI for HTML. I am following the SAP note 1010519. However, nothing seems to change, even after adding the parameter ~webgui_simple_toolbar = 0 or any other value.
    I added the parameter to the service: default_host ->sap -> bc -> gui ->sap -> its -><b>webgui</b>
    After going through few posts relating to this issue, I figured out that passing application parameters would not work. Also, using IAC is not an option for me.
    Can someone help? How can I hide the OKCode field and Menu bar?
    Thanks and Regards,
    Reena

    Hello Reena,
    Maintaining the parameter
    ~WEBTRANSACTIONTYPE   EWT
    will solve your problem. You can also create an IAC iview. Here is a document for the same.
    <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/_d-f/Displaying%20SAP%20Transaction%20as%20Internet%20Application%20in%20Portal.pdf">How to diplay a transaction as IAC iview</a>
    Also remove the parameter ~noheaderOkCode.
    Hope that helps.
    Regards
    Deb

  • GUI event handling problems appear in 1.4.1 vs. 1.3.1?

    Hi,
    Has anyone else experienced strange event handling problems when migrating from 1.3.1 to 1.4.1? My GUI applications that make use of Swing's AbstractTableModel suddenly don't track mouse and selection events quickly anymore. Formerly zippy tables are now very unresponsive to user interactions.
    I've run the code through JProbe under both 1.3 and 1.4 and see no differences in the profiles, yet the 1.4.1 version is virtually unusable. I had hoped that JProbe would show me that some low-level event-handling related or drawing method was getting wailed on in 1.4, but that was not the case.
    My only guess is that the existing installation of 1.3.1 is interfering with the 1.4.1 installation is some way. Any thoughts on that before I trash the 1.3.1 installation (which I'm slightly reluctant to do)?
    My platform is Windows XP Pro on a 2GHz P4 with 1GB RAM.
    Here's my test case:
    import javax.swing.table.AbstractTableModel;
    import javax.swing.*;
    import java.awt.*;
    public class VerySimpleTableModel extends AbstractTableModel
    private int d_rows = 0;
    private int d_cols = 0;
    private String[][] d_data = null;
    public VerySimpleTableModel(int rows,int cols)
    System.err.println("Creating table of size [" + rows + "," + cols +
    d_rows = rows;
    d_cols = cols;
    d_data = new String[d_rows][d_cols];
    int r = 0;
    while (r < d_rows){
    int c = 0;
    while (c < d_cols){
    d_data[r][c] = new String("[" + r + "," + c + "]");
    c++;
    r++;
    System.err.println("Done.");
    public int getRowCount()
    return d_rows;
    public int getColumnCount()
    return d_cols;
    public Object getValueAt(int rowIndex, int columnIndex)
    return d_data[rowIndex][columnIndex];
    public static void main(String[] args)
    System.err.println( "1.4..." );
    JFrame window = new JFrame();
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    Dimension size = new Dimension(500,500);
    panel.setMinimumSize(size);
    panel.setMaximumSize(size);
    JTable table = new JTable(new VerySimpleTableModel(40,5));
    panel.add(table);
    window.getContentPane().add(panel);
    window.setSize(new Dimension(600,800));
    window.validate();
    window.setVisible(true);
    Thanks in advance!!
    - Dean

    Hi,
    I've fixed the problem by upgrading to 1.4.1_02. I was on 1.4.1_01.
    I did further narrow down the symptoms more. It seemed the further the distance from the previous mouse click, the longer it would take for the table row to highlight. So, clicking on row 1, then 2, was much faster than clicking on row 1, then row 40.
    If no one else has seen this problem -- good! I wouldn't wish the tremendous waste of time I've had on anyone!
    - Dean

  • Creating GUI component that includes other components

    Hello, I need to create an UNIVERSAL FORM (panel) consisting of several textboxes and labels. These textboxes and labels will be defined in XML. I want it as a GUI JavaBean. It should be made from a panel with some layout and it should consist other components. Here are my questions:
    1) What class to derive from? JPanel?
    2) Well, when I override a GUI Swing component I must implement a paint method but this is a bit strange. I just want to set up the textboxes -- I do not need any special painting. A question appears -- is JavaBean technology good for this situation? Is there any better solution?

    I mean why this doesn`t work:
    public class Uniform extends JComponent implements
    Serializable {
         private String xmlContent;
         private int type;
         private JPanel panel;
         public Uniform() {
              panel = new JPanel(new GridLayout(1,2));
              panel.add(new JTextField("A"));
              panel.add(new JTextField("B"));
         public void paint(Graphics g) {
              panel.paint(g);
    }Is it a good solution? How would you solve the
    problem?
    Thanks for your ideas.If you mean by 'dont' work' that your text boxes and panel doesn't appear, then it's because you're missing this line in your constructor:
    public Uniform() {
      this.add (panel, BorderLayout.CENTER);
    }Regards,
    Devyn

  • Creating pl/sql procedure problems

    Dear all,
    I have problems with creating a procedure which select returns more then one row.
    CREATE OR REPLACE PROCEDURE ECM_DATA.check_padrones_datos
    IS
      v_padron_check   VARCHAR2(50);
      v_padron_number   VARCHAR2(50);
    BEGIN
       SELECT count(pd.estado)
       INTO v_padron_check
       FROM par6.padrones_datos pd, par6.padrones p, par6.FECHAS f
         where pd.estado not in ('2000','8000')
         AND PD.ARCHIVO = P.ARCHIVO
         AND P.FECHA = F.datum_s;
        DBMS_OUTPUT.PUT_LINE('Št. neuspešnih zapisov :  ' || v_padron_check);
        SELECT distinct pd.archivo
       INTO v_padron_number
       FROM par6.padrones_datos pd, par6.padrones p, par6.FECHAS f
         where pd.estado not in ('2000','8000')
         AND PD.ARCHIVO = P.ARCHIVO
         AND P.FECHA = F.datum_s;
        DBMS_OUTPUT.PUT_LINE('Padron št. :  ' || v_padron_number);
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
         v_padron_number := 'Vsi padroni so OK';
         DBMS_OUTPUT.PUT_LINE('Padron št. :  ' || v_padron_number);
    END;
    Error ->  -01422: exact fetch returns more than requested number of rows
    Select returns 2 or more rows.
    SELECT distinct pd.archivo
        FROM par6.padrones_datos pd, par6.padrones p, par6.FECHAS f
         where pd.estado not in ('2000','8000')
         AND PD.ARCHIVO = P.ARCHIVO
         AND P.FECHA = F.datum_s;
    How to write correct syntax in pl/sql. I apologize in advance for rookie questions. Any help would be appreciated.
    Regards,
    Robert

    The exact implementation depends on the use case.
    You can loop through the results
    FOR r IN (
        SELECT  DISTINCT pd.archivo
        FROM    par6.padrones_datos pd
               ,par6.padrones p
               ,par6.fechas f
        WHERE   pd.estado not in ('2000','8000')
        AND     pd.archivo = p.archivo
        AND     p.fecha = F.datum_s
    LOOP
        dbms_output.put_line('Padron št. :  ' || r.archivo);
    END LOOP;
    Or maybe you can process all results in one step, e.g. if you want to update a table based on the select.
    Regards
    Marcus

Maybe you are looking for

  • HP Laserjet P1005 driver for winows 7 64bit

    I am a member of MSDN, I installed winows 7 Professional 64 bit. It is a good system, but...... I have Hp Printer Model Laserjet P1005, I tried in compact mode, it still does not working in . I need driver for it. Thanks

  • How do I get video clips out of menu button?

    iMovie 9.0.8  iDVD 7.1.2 I have a 90 minute video with 11 chapters.  I found in "edit" menus something called populate drop zones" and clicked it for main page and two sub menu pages.  When trying to burn,  I got the error message "- There seems to b

  • PhotoShop Elements 10...I need help with font size for watermark in Processing Multiple Files.....

    I have PhotoShop Elements 10, and I am trying to watermark some of my photos, I have successfully added them one at a time with a font large enough to be seen. Now I am trying to add it using the "process multiple files" , I can do that but the font

  • My Mac isn't showing all of my files.

    I opened "About This Mac" and discovered that I have only around 46 MB of storage left out of the available 59.81 GB. Apparently I have 46.18 GB of "Other". I looked in finder and I have around only 25-30 files, each taking up only a few MB of storag

  • DMEE: Error in conditions for node Invcr: reference ID IDTP is not permitte

    Hi  Friends , I have problem with nodes in DMEE . When child node is from a Exit funtion moduel , not from the Payment FPAYH/FPAYP/HX structures, is empty . I dont want the parent node to be displayed . EX: <INVCR>  - Should not display when node2 is