ServiceLocator for swing app

can anyone show me way how to speedup ejb invocation from remote swing app?
I read about servicelocator for jsp application, but can no find topic about remote swing app servicelocator.
my network call to remote ejb methods is dramatically slow :(
thanks !

Yes, good question, on my remote app it is very slow too....

Similar Messages

  • How to write initial installer for swing app

    Hi,
    can anyone out there help me in writing the installer for an swing application which involves dowloading jars, external jars(third party) and some data files like xml etc..
    how should i write the starting installer file for my app?
    Thanks in advance
    TSR

    Hi there,
    We found the solution to download the external jars we have kept all the
    external jars seperatly untouched and unsigned by us in a directory in webserver and in the main jnlp we are specifying the extension jnlp file where i am specifying the list of jar files will be downloaded to the client without any hic-ups of security check.
    Note:
    1) In extension jnlp file <security> tag should be omitted.
    2) In main jnlp file the application startup main class should have
    System.setSecurityManager(null); as the first statement in the
    main() method.
    3) Place all the jars which are signed by you in the main jar file
    where you need to put <security> tag with "all-permissions" value.
    Thanks,
    TSR

  • Ant questions: for Swing apps?

    I have used Ant for my J2EE programs by deploying the ear file to the server. For my swing desktop apps I have used an executable Jar file, or JBuilder makes me a windows .exe file.
    Can you use ant builds to make something appropriate for deploying Swing apps?
    Thanks!
    Amber

    Does this link help ?
    http://ant.apache.org/manual/CoreTasks/jar.html

  • Building Swing app in Ant

    I use IntelliJ as my IDE and when building my swing app through IntelliJ, the application works fine. However when I build it use Ant, I get a NullPointerException in the main thread. Is there anything special that needs to be done for Swing apps when compiling with Ant.

    Try using an MVC architecture, where the view is the JTree and the model is the treeModel. Make the treeModel implement Observable , and then use the Observable/Observer mechanism to notify the view of updates. Make sure the updates of the treeModel happen in a separate thread, not in the AWT event thread.
    Hope this helps

  • How to create printable report from a swing app.

    Hi,
    I have googled quite a bit and have searched the forum extensively but haven't found answers to my questions.
    I have a small swing based application (that uses jtextfields, jbuttons, jlist, etc) that collects information from user
    and stores in some variables; which are like strings, integers, hashmap, etc.
    Now this information is to be formatted and is to be printed as a report.
    Formatted as in, some part of the collected text is to be printed in certain font and other in different color and so on.
    Also the report is to be printed on a paper leaving some space at left and at the top. That means margins need to be set.
    And before all info is to be sent to printer I need to display this information in some report viewer (preview).
    How can I format certain text and set margins? (Is there some Document kind of api which allows me to set margins, change font of certain text?)
    How should I display this text / information as a print preview? (Should I use jeditorpane / jtextpane ?)
    How should I send all the information to the printer? (What java api should be used for printing?)
    The data entered by the user is not saved / persisted to any database. It's to be sent to the printer after submit button is pressed on the swing app.
    Since there is no database I couldn't use jasper-reports.
    Following are links to all threads (not useful) I found when I searched for swing / print / report in the forum :
    http://forums.sun.com/thread.jspa?forumID=331&threadID=225351
    http://forums.sun.com/thread.jspa?forumID=57&threadID=576758
    http://forums.sun.com/thread.jspa?forumID=57&threadID=570629
    http://forums.sun.com/thread.jspa?forumID=1&threadID=489905
    http://forums.sun.com/thread.jspa?forumID=57&threadID=571093
    http://forums.sun.com/thread.jspa?forumID=257&threadID=138450
    http://forums.sun.com/thread.jspa?forumID=57&threadID=583150
    http://forums.sun.com/thread.jspa?forumID=57&threadID=5399572
    http://forums.sun.com/thread.jspa?forumID=57&threadID=579619
    http://forums.sun.com/thread.jspa?forumID=57&threadID=593199
    Help would be much appreciated.

    alan_mehio wrote:
    The simplest thing to do in your case is to load the file content into the JTextArea
    then to create the header and the footer if there is any from java.text.MessageFormat
    then you invoke the print method on the JTextArea instance object> Just let me know if you are face any furrher problem
    Alan Mehio,
    I have been able to set margins and get the printout just the way I want it (after some experiments / trial & error).
    But the problem is, parameters to paper.setImageableArea() are hard coded as in the example code below :
            System.out.println("print?");
            PrinterJob printJob = PrinterJob.getPrinterJob();
            if (printJob.printDialog()) {
                PageFormat pf = printJob.defaultPage();
                Paper paper = pf.getPaper();
                paper.setSize(8.5 * 72, 11 * 72);
                System.out.println("paper width : " + paper.getWidth());// expecting 612
                System.out.println("paper height : " + paper.getHeight());// expecting 792
                System.out.println("ImageableHeight : " + paper.getImageableHeight());
                System.out.println("imageable width : " + paper.getImageableWidth());
                System.out.println("ImageableX : " + paper.getImageableX());
                System.out.println("Imageable y : " + paper.getImageableY());
                //paper.setImageableArea(108, 144, paper.getWidth() - 108, paper.getHeight() - 144);
                paper.setImageableArea(222, 244, paper.getWidth() - 222, paper.getHeight() - 244);
                pf.setPaper(paper);
                printJob.setPrintable(jTextArea1.getPrintable(null, null), pf);
                try {
                    printJob.print();
                } catch (Exception ex) {
                    System.out.println("exception while printing...");
                    ex.printStackTrace();
            }In my case the left margin should be 1.5 inches (38.1mm) and top margin should be 2 inches (50.8 mm)
    Considering 72dpi printer for a A4 size page (8.5in X 11in), the parameters to paper.setImageableArea() should be
    (108, 144, paper.getWidth() - 108, paper.getHeight() - 144);
    But the printout leaves only 1inch for top and left margins.
    Here are o/p lines for method-call with above said params :
    paper width : 612.0
    paper height : 792.0
    ImageableHeight : 648.0
    imageable width : 468.0
    ImageableX : 72.0
    Imageable y : 72.0
    When I pass the following values I get text printed with desired margins on the paper but the above printlns remain exactly the same!
    paper.setImageableArea(222.4, 244, paper.getWidth() - 222.4, paper.getHeight() - 244);
    Although I have been able to achieve what I wanted to without using 3rd party libraries,
    I feel this hard coding of values isn't a good idea and leaves a doubt whether this will work on other systems with different printers.
    My question is, how to get these numbers correct every time? Is there a formula for obtaining these numbers?
    Also formatting of certain part of to-print text is something that is yet to be figured out.
    Thanks.

  • Keyboard Problem while running Swing App on LINUX

    Hi All,
    We have a Swing based Application running on Windows Platform. We need to run the Application on LINUX. The Application does not have any problem and runs without problems for a few minutes but after that the keyboard stops to respond inside the application. Keyboard runs fine outside the application but no key events are recognized inside the application. Mouse is working fine even after the keyboard stops responding.
    Key Points:
    �     The keyboard is a PS/2 keyboard.
    �     Read Hat Fedora 5.0 is being used.
    �     The problems occur on both KDE and GNONE.
    �     The Java Version is jdk1.5.0_09
    The application is data entry application using EJB at server side. The client UI has lot of JTables and Desktop Panes/ Internal Frames. User use ctrl+tab, ctrl+shift+tab, tab, shift+tab, and other hot keys to navigate between Components. Listeners on keyboard Focus Owner are also used. We are unable to diagnose the problem because of the undeterminable nature of the problem. The problem occurs at anytime and does not occur on any special key/ combinations press.
    Thanks and Regards,
    Nishant Saini
    http://www.simplyjava.com

    I've just installed the JDK 1.4 on my debian box. I
    can compile and run a basic Hello World app using
    System.println, but when I try to run a simple swing
    app, I get an error like:
    Exception in thread "main"
    java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.... etc, etc.
    It goes on with about 30 different classes. It
    compiles fine, with no errors, but when it comes time
    to run, that's what I get. This is what I have in my
    .bash_profile as far as environment variables go:
    export JAVA_HOME="/usr/local/j2sdk1.4.1_01"
    export PATH="$JAVA_HOME/BIN:$PATH"
    export
    CLASSPATH="$JAVA_HOME/jre/lib/:$JAVA_HOME/lib:."The code works fine in Windows, so unless there's
    something platform-specific, I don't think there's a
    problem there. I've checked to make sure I'm not
    running kaffe by accident and I'm definitely running
    the right java and javac. I'm out of ideas. Any
    suggestions would be greatly appreciated.
    -dudley
    I may just be crazy, but your PATH looks a little screwy to me. I was under the impression that the standard java installation has its executables in the 'bin' directory, not the 'BIN' directory. Unless Debian has fallen to the evil empire, then I'm fairly sure file names are case-sensitive. I don't know if that will fix your problem though. Do you compile from the command line, or do you use an IDE???

  • BC4J Application Module Pooling for JClient App

    Helo,
    i wonder why all documentation about bc4j application module pooling available is for Web app ? (jsp) . I'm creating swing JClient app and i need some doc about how the application module pooling works in this kind of application.
    anybody know where can i get those docs ?
    Need help and Thank you,
    Ricky H.P.

    Connection pooling can be achieved when a JVM instance manages the pool, in 3tiers the Java App. Server has that task.
    If you are 2tiers that means that you are communicating with the database through JDBC.
    When a user launches your JClient app in fact he lauches his own JVM instance so I don't how he could share a pool with other users.
    In your case you have at most 2 open transactions per user.
    You can achieve that by sharing a same binding context with n forms composed of m panels.
    Let's say:
    1 main form
    connection 1: forms a,b,c
    connection 2: forms x,y,z
    In your main form your open your 2 connections and share them.
    You can achieve that by:
    1) in our main form, initialize 2 binding containers
    Example of one:
    DCBindingContainer bc1 = this.createBindingContainer("package name","model name");
    private DCBindingContainer createBindingContainer(String packageName, String panelModelName)
    StringBuffer sb = new StringBuffer(packageName);
    sb.append(ViewConstants.STRING_DOT);
    sb.append(panelModelName);
    DCBindingContainerDef bcdef = DCBindingContainerDef.findDefObject(sb.toString()); //NOTE THE NAME.
    if (bcdef == null)
    throw new JboException("System error, "+getClass().getName()+".createBindingContainer, DCBindingContainerDef: "+sb.toString()+" not found");
    DCBindingContainer bc = bcdef.createBindingContainer(panelBinding.getBindingContext());
    bc.setName(panelModelName);
    panelBinding.getBindingContext().put(panelModelName, bc);
    return bc;
    2) Before that the jbInit method gets called in the called form, set the binding context:
    form1 = new Form1(...);
    form1.setBindingContainer(bc1) ;
    Example of methods in form 1 and form 2:
    public void setBindingContainer(DCBindingContainer ctr)
    this.panelBinding = (JUPanelBinding)ctr;
    setBindingContext(ctr.getBindingContext());
    public void setBindingContext(BindingContext bindCtx)
    if (panelBinding.getPanel() == null)
    panelBinding = panelBinding.setup(bindCtx, this);
    registerProjectGlobalVariables(bindCtx);
    panelBinding.refreshControl();
    try
    System.out.println("Form setBindingContext calling jbInit");
    jbInit();
    panelBinding.refreshControl();
    // FL added
    isBindingContextSet = true;
    System.out.println("Form isBindingContextSet true");
    catch(Exception ex)
    System.out.println("Form setBindingContext exception caught");
    panelBinding.reportException(ex);
    Regards
    Fred

  • Launching Swing apps in foreground remotely

    We have an agent that runs on our machines waiting to start and stop java applications, but there is a problem when the application has a GUI element to it. We are using the RunTime classes and it executes applications in the background which means that GUIs cannot be seen even though they are running.
    What is the secret to automatically launching java swing apps in the foreground?
    Thanks in advance.

    Replying to myself, as I think I've just found the answer (at least for an windows environment)
    --> Just start your app with "javaw" instead of "java"
    (What would be the right way to do it in Linux, for instance?)
    Joao Clemente

  • Swing app keyboard stops working, mystery ESCAPE keystrokes appear in EDT

    Java 6 Swing app. In our development environment, works great. In QA, they use it for a bit, type in a text field, click out to a Windows XP/7 app, click back in the text field, and the keyboard stops accepting keystrokes. The mouse continues to work, and the Swing app continues to paint to the screen.
    I hooked up a KeyEventDispatcher to listen to what is going on. I'll post a more verbose log at the end of this post, but the short version is this. When the keyboard hangs, the log shows that 'escape' keys are being sent, though we do not do any keystroke injection in our app, ESCAPE or otherwise. Nothing on the Swing app can be determined visually to have focus.
    Just before the app starts hanging, it has a side effect of not being able to be brought into the foreground by clicking on it, if, for example, one was working with Excel or Notepad, then try to click on the JFrame title of the app, or anywhere else on the app frame/internals. Once this condition happens, moving away to another Windows app, then going back to the Swing app, causes the keyboard to stop working and the KeyEventDispatcher to see 'escape' keystrokes being sent out.
    Connecting remotely to the app via JVisualVM/JConsole does not show any of the threads hanging/blocked.
    Sometimes you can work for hours before seeing this problem, and other times, you can start the app up and it happens right away. Once it happens, sometimes you can't recover, and sometimes you can click on a button on a navigator panel on the left side that displays an info panel on the right side, and you can start typing again in text fields.
    Once this problem happens, you can start (or have already running) a completely different Swing app (ex.: StackTrace), and the keyboard will stop working for that app too, even though its running in its own separate VM.
    This problem (ALMOST!) always happen when typing in a Swing text field (JTextField, JTextArea, etc.), clicking on and then typing in a Windows text area (Excel cell, Notepad), then clicking back into the Swing app's text field. A few times, we've gotten this to happen by typing in a text field, tabbing to a button, pressing a button, then tabbing/clicking back into the text field, all without leaving the Swing app. But this latter scenario is rare, usually going to/from Swing/Windows XP/7 apps cause the problem to occur more readily.
    The QA computers normally use Citrix to connect and run the app, but this also happens if we run the app completely locally. But again, this only happens to some computers, all of the ones in the QA department; the development computers (the app has not been released into production yet) does not see this problem.
    I had thought that our problem was this problem (Wrong characters in KeyEvents generated from input of barcode scanner but purposely slowing down the acceptance of KEY_PRESSED and KEY_RELEASED events before allowing them to go on to the Swing app (via a KeyDispatcher) did not solve the problem.
    Also, we had thought it might be a Citrix problem and how it (or does it?) hook into the Windows keyboard. The fact that once one Swing app gets into this keyboard doesn't work and escape keys are being sent out by the EDT can affect another Swing app makes me wonder. We're not seeing any VM exceptions either like this (EXCEPTION_ACCESS_VIOLATION - JRE 6.0_23 - Citrix, windows 2003
    Been trying to get this one solved for over a week, but with no luck. Any help/advice would be appreciated. Thank you in advance for your time.
    P.S. Here's the detailed log info I generated via my KeyEventDispatch listener...
    2011-04-01 11:58:17,493 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:36 - KEY1-keystroke [java.awt.DefaultKeyboardFocusManager@377369]: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=27,keyText=Escape,keyChar=Escape,keyLocation=KEY_LOCATION_STANDARD,rawCode=27,primaryLevelUnicode=27,scancode=1] on javax.swing.JTextField[,320,28,175x18,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=com.ep.skin.lnf.framework.utils.internal.RoundedBorder@c3a7c0,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=15,columnWidth=11,command=,horizontalAlignment=LEADING]
    2011-04-01 11:58:17,494 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:42 - KEY2-ActiveWindow: javax.swing.JFrame[mainFrame,128,128,1024x768,invalid,layout=java.awt.BorderLayout,title=My - HQ - 17601,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,1024x768,invalid,layout=com.ep.skin.lnf.framework.internal.RootPaneUI$MetalRootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource@d0e678,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    2011-04-01 11:58:17,496 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:48 - KEY3-CurrentFocusCycleRoot: javax.swing.JFrame[mainFrame,128,128,1024x768,invalid,layout=java.awt.BorderLayout,title=My - HQ - 17601,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,1024x768,invalid,layout=com.ep.skin.lnf.framework.internal.RootPaneUI$MetalRootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource@d0e678,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    2011-04-01 11:58:17,497 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:54 - KEY4-FocusedWindow: javax.swing.JFrame[mainFrame,128,128,1024x768,invalid,layout=java.awt.BorderLayout,title=My - HQ - 17601,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,1024x768,invalid,layout=com.ep.skin.lnf.framework.internal.RootPaneUI$MetalRootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource@d0e678,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    2011-04-01 11:58:17,498 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:60 - KEY5-FocusOwner: javax.swing.JTextField[,320,28,175x18,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=com.ep.skin.lnf.framework.utils.internal.RoundedBorder@c3a7c0,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=15,columnWidth=11,command=,horizontalAlignment=LEADING]
    2011-04-01 11:58:17,499 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:66 - KEY6-PermanentFocusOwner: javax.swing.JTextField[,320,28,175x18,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=com.ep.skin.lnf.framework.utils.internal.RoundedBorder@c3a7c0,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=15,columnWidth=11,command=,horizontalAlignment=LEADING]
    2011-04-01 11:58:17,501 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:74 - KEY7-stacktrace...
    com..client.util.MyKeyEventDispatcher$StackTraceGenerationException: This exception was created to generate a stack trace, and can be safely ignored.
         at com..client.util.MyKeyEventDispatcher.dispatchKeyEvent(MyKeyEventDispatcher.java:73)
         at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    2011-04-01 11:58:17,504 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:36 - KEY1-keystroke [java.awt.DefaultKeyboardFocusManager@377369]: java.awt.event.KeyEvent[KEY_RELEASED,keyCode=27,keyText=Escape,keyChar=Escape,keyLocation=KEY_LOCATION_STANDARD,rawCode=27,primaryLevelUnicode=27,scancode=1] on javax.swing.JTextField[,320,28,175x18,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=com.ep.skin.lnf.framework.utils.internal.RoundedBorder@c3a7c0,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=15,columnWidth=11,command=,horizontalAlignment=LEADING]
    2011-04-01 11:58:17,506 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:42 - KEY2-ActiveWindow: javax.swing.JFrame[mainFrame,128,128,1024x768,invalid,layout=java.awt.BorderLayout,title=My - HQ - 17601,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,1024x768,invalid,layout=com.ep.skin.lnf.framework.internal.RootPaneUI$MetalRootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource@d0e678,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    2011-04-01 11:58:17,507 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:48 - KEY3-CurrentFocusCycleRoot: javax.swing.JFrame[mainFrame,128,128,1024x768,invalid,layout=java.awt.BorderLayout,title=My - HQ - 17601,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,1024x768,invalid,layout=com.ep.skin.lnf.framework.internal.RootPaneUI$MetalRootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource@d0e678,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    2011-04-01 11:58:17,508 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:54 - KEY4-FocusedWindow: javax.swing.JFrame[mainFrame,128,128,1024x768,invalid,layout=java.awt.BorderLayout,title=My - HQ - 17601,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,1024x768,invalid,layout=com.ep.skin.lnf.framework.internal.RootPaneUI$MetalRootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource@d0e678,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    2011-04-01 11:58:17,509 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:60 - KEY5-FocusOwner: javax.swing.JTextField[,320,28,175x18,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=com.ep.skin.lnf.framework.utils.internal.RoundedBorder@c3a7c0,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=15,columnWidth=11,command=,horizontalAlignment=LEADING]
    2011-04-01 11:58:17,510 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:66 - KEY6-PermanentFocusOwner: javax.swing.JTextField[,320,28,175x18,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=com.ep.skin.lnf.framework.utils.internal.RoundedBorder@c3a7c0,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=15,columnWidth=11,command=,horizontalAlignment=LEADING]
    2011-04-01 11:58:17,512 [AWT-EventQueue-1] DEBUG MyKeyEventDispatcher.dispatchKeyEvent:74 - KEY7-stacktrace...
    com..client.util.MyKeyEventDispatcher$StackTraceGenerationException: This exception was created to generate a stack trace, and can be safely ignored.
         at com..client.util.MyKeyEventDispatcher.dispatchKeyEvent(MyKeyEventDispatcher.java:73)
         at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    The above log info repeats multiple times, KEY_PRESSED and KEY_RELEASE, over and over again, for 'escape' keys.
    Edited by: 850693 on Apr 7, 2011 10:16 AM (typo fix)
    Edited by: 850693 on Apr 7, 2011 10:19 AM (Fixed links)

    <discaimer>Don't put too much hope in my reply</disclaimer>
    The only real difference is QA has the Citrix client installed on them, and development does not. You don't need to run our Swing app through a Citrix client though to cause the bug/freezing, just running it on a PC with the Citrix client seems to be enough (in theory). We've been working down a checklist of possible problems/solutions, and we've gotten to the "Install Citrix to the dev PC" item now, so I'll post back if that makes a difference or not in reproducing the problem.
    I've also had QA people actually come over to a dev PC, without the Citrix client, and try to reproduce the problem, and they have not been able to. There's 'something' about their environment vs. ours, but not sure how that would manifest itself as a AWT/Swing keyboard event of mysterious escape keystrokes followed by the locking up on the keyboard, but not the whole Swing app. My personal guess is the Citirix client installing funky Windows-level keyboard driver(s), but I may be totally off on that. /shrugI read your initial post twice and couldn't find out whether you reproduce that on several different machines, so one "environmental" difference comes to mind: have you tried using another keyboard on the defective QA configuration?
    Of course that doesn't explain in itself how the problem would manifest only after switching back and forth to a native Windows app, but then, with the hint that Citrix may make a difference, maybe one driver filters out repeated "Esc" keystrokes, while another doesn't, and that manifests only after a few app switches, and the system event queue, or whatever it's called in Windows, redirects the events to the target app/window?
    Other than that, I wish you had investigated Jeanette's pacemaker hypothesis more... ;)
    Otherwise, yeah. I have a hook in to see all AWTEvent's, but I still need to see/find what's posting the mysterious escape keys to the event queue.I assume it's what you mean, but I'll try to make that clear: you have to investigate, at the OS level, what is posting escape key events to the OS queue.
    I am not a Windows developper, but I seem to understand that the following programs claims to capture keystrokes on the whole screen (not limited to a single window), with some limitations: http://www.codeproject.com/KB/winsdk/WIN_RECORDER.aspx
    More generally, you should search for a Windows way to peek at the Windows' (keyboard?) event queue.
    I'm not sure this could identify which DLL (if it's not originated by the material, see the defective keyboard hypothesis) is posting the events, but that's worth a try (Java for example, would enables to stuff a custom event queue that would trace info about a Java-poster).
    Even if you can't identify the posting DLL, running the "key captuyre" on both the Windows host that has the Citrix window, and the Windows host that you are accessing via Citrix, may give you hints as to where the heck the key strokes originate...
    Good luck, and keep us informed,
    J.

  • Swing app in JDK6 continues to rendering slow in Windows Terminal Server

    Hi,
    Because Swing apps create interfaces internally and not using default OS APIs,
    when running into a Windows Terminal Server client, there is no way to optimize
    rendering. Windows Terminal Server and Linux FreeNX use a mechanism to send
    to client only commands to render the windows. But, because the way Swing works,
    not totally integrated to OS APIs, it's not possible for terminal servers to do this,
    and these servers render Swing like images, something like VNC do, very slower than.
    I have tested native apps and AWT apps, and the difference is very significant,
    something like 50-70% faster.
    Is there some project in Swing APIs or java.net open-sources to better this?

    We are also seeing this issue with a Compiere implementation. With 10 distributed sites across the US, our client wanted to use Windows Terminal Services to simplify the client desktop management of the Swing application.
    But performance is terrible...and screen painting issues a real problem. We are also on JDK5 still, so I'm discouraged to see that JDK6 doesn't appear to offer much improvement?
    Is there any project afoot to address this issue for installations using terminal services?
    Thanks,
    Peter

  • Can any one tell me how to prepare for Swing interview

    hai,
    I have been working on swings for 18 months, till now i never attended any interview. I am having an nterview next week, i dont know what to prepare and how to prepare fo the interview. The only thing i know is how to use Swing components, i dont know theorytical part of it. Please some one guide me how to prepare for the interview. Please provide me interview questions. so that i may be bit confident while attending the interview.
    Thanks in advance
    Ravi

    This might give you an idea :
    http://forum.java.sun.com/thread.jsp?forum=57&thread=317742
    but I have no suggestion how to prepare, apart from writing as many Swing apps as possible.

  • Best way to manage images in a swing app

    Hi.
    I have a swing app that uses alot of images around 100+ at around 40kb each.
    I am currently using new ImageIcon("icon\\main.png")) to create them.
    Is this the most efficient way to manage images?
    Would it be more efficeint to store then in the mysql database?
    and / or use SwingWorker (http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html)
    Cheers
    Bobby

    Hi Bobby,
    It depends on what you want to be more efficient:
    1) CPU cycles
    2) Reducing jar size
    3) Ease of maintenance
    4) Prevent typing errors in file names
    For me, number 3 and 4 are important. So, what I generally do, is create an enum that desribes the images that are contained in the same package as the enum. Now I'm able to change the package name with no consequence. I only have to type the filename once and know when I have to double check of what I type. Something like this:
    package org.pbjar.geom.images;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.ImageIcon;
    public enum Images {
        AUTHOR_SMALL("TheAuthor.jpg"),
        AUTHOR_LARGE("PietKopLarge.jpg"),
        private final String filename;
        Images(String filename) {
         this.filename = filename;
        public ImageIcon getIcon() {
         return new ImageIcon(getImage());
        public BufferedImage getImage(){
         try {
             return ImageIO.read(getURL());
         } catch (IOException e) {
             throw new RuntimeException(e);
        public URL getURL() {
         return this.getClass().getResource(filename);
    }Piet

  • Expandable Menu in Java Swing app

    Hello JFriends,
    is it possible to create a expandable menu in java swing app? I am thinking of something like menu in MS Visio: http://img32.imageshack.us/i/menuip.jpg/
    It works like that: When user click on a bar it expands (with nice animation) and shows containing components.
    Or maybye there are components like that?
    Thanks in advance for Your reply and please forgive me if my english is bad.
    JRegards :-)

    Yes, such constructs are possible. There isn't a pre-made component exactly like that. The NetBeans IDE has a Window - named Palette - that's very similar. The code is open source.
    You can read about Java menus here:
    [http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html]

  • Is it possible to run my swing app in another jre

    Hi All,
    I have a swing app jar deployed in the server having jre. It may be possible that the client may have a lower version of jre. In that case would it be possible to download the jre itself from the server (local server not Sun server) and then the run the application in the downloaded jre. The client may be in windows or linux. Please give me steps to go about it. Am new to web start. Please help ASAP.
    Thanks to all the folks out there keeping the java community alive and kicking

    Hi Andy,
    I wanted to bring the jre on the client machine on par with the one in my server which hosts the application to be launched by web start. I had posted a query on how to install a newer version of jre other than using the sun's auto installer site. I had to search high and low for such a solution. Finally got a set of servlets called web start services from the following site :
    http://lopica.sourceforge.net/.
    It helped me to host the jre installer on my server itself which woulc be used by the client to install a higher version of jre if required. I was trying to install a runtime installer of jre as per their instructions. I created a jar file called jre_1.5.05.jar created by doing a jar -cvf on the jar directory. And gave the j2se version required as <j2se version="1.5.05"> and then my helloapp.jar. Everything goes fine during the installation. It also asks me for the reboot and I did the same. However when I try to run the application, it says
    "Bad Installation. Error involving Java VM (SysExec) and then points to the directtory inm the cache as .ext/E11332440658/bin/javaw.exe.
    So I went to the directory .ext/E11332440658 in the cache. and I see that the jar has been in jarred as jre_1.5.0_05/bin/javaws.exe which should have been the actual path where web start should have looked.
    Do you have any idea why it happened? Is it possible to correct it without doing anything manually at the client side? Please reply ASAP.
    Zeus.

  • How make Swing app Rotated 90 Deg? i.e. On its side

    I want to make my entire swing app (including buttons, JTextArea, etc) rotated 90 deg to the right. I know this sounds weird, but I want to do it for a PDA. I can use swing on a PDA (check on google for swing personal java) and I want to be able to have the screen the long width.
    Does anyone know how I can do this?

    I can suggest some solution but it has not been proved to work. So just read it and make your own component carefully.
    First, subclass the Swing-widget to be rotated and name it RButton or whatever.
    Then, draw the content on a new BufferedImage instance and use AffineTransform to draw this BufferedImage onto the original Graphics context. Here is the example code.public class RButton extends javax.swing.JButton {
      public void paintComponent( Graphics g ) {
        // 1. create a new BufferedImage to draw on.
        BufferedImage bi = new BufferedImage( this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB );
        // 2. draw the content (using JButton's paintComponent())
        super.paintComponent( bi.getGraphics() );
        // 3. save the old transformation matrix
        Graphics2D g2 = (Graphics2D)g;
        AffineTransform oldTransform = g2.getTransform();
        // 4. set the rotation transformation matrix
        g2.setTransform( AffineTransform.getRotateInstance( Math.toRadians( /*degree*/ ) ) );
        // 5. draw the BufferedImage on 'g'
        g2.drawImage( bi, 0, 0, this );
        // 6. reset the old transformation matrix
        g2.setTransform( oldTransform );
    }And this suggestion will just rotate the drawn content. You have to resize and rearrange those Rxxx components you've created to fit with the rotated graphics.

Maybe you are looking for

  • Script to import layers in other file

    Hello, i'm new to this forum but i use a lot of scripting for my workflow... and there is something i need to do  : i need to import all groups and layers from a local PSD file (that is "my master" with all guidelines from my client : position, space

  • Dreamweaver CS5 Errors, translators were not loaded Please Help!

    Hi, Recently my computer had problems, I had to install Windows7 instead of Windows Vista. whenever I open "Dreamweaver CS5", I have this pop-up error message: The following translators were not loaded due to errors: ASP.htm: has configuration inform

  • Save .eps to .jpg format

    I want to use an .eps on my website so need to convert it to .jpg but File/Save As does not have the .jpg option.

  • Standard Images for a ADF project

    Hi All I am doing a small project in ADF and would need images for icons like home,search - Can someone help me get images for standard icons in oracle ? Like the ones in the Oracle GIT page. Thanx Varsha

  • Photoshop CS4 Ex. disc not accepted by computer

    Hi, I've just tried to mount DVD Photoshop CS4 extended but my Mac pro 2x2.66 GHz Dual- Core Intel, running Mac OS X version  10.5.8, will not accept it. The disc is ejected. Other applications on DVD are accepted so the problem cannot be the interna