Java GUI examples?

Hello,
I am hoping someone can point me in the right direction. I have seen tons of examples of how to create text boxes, graphics, buttons and what not in Java. What I have not been able to find is an example of a program that actually calls other methods.
I guess I am having a difficult time understanding how to apply the cool graphical elements to my already existing project. For example, I need to display a list of items stored in an array using a GUI.
Do I create a seperate class for the GUI? or can I slap this code right into my main method?
Thanks for all the help.
Rgds,
Paul

Hi Icycool,
I have seen these, thank you. What I am confused about is how to apply these to other code. I can run through the examples but I do not see how I can use these in an actual program.
For instance. I have a main method which calls another class. I construct the objects from the class, create an array, and need to display this info in a GUI. It's nothing complicated.
I just don't understand where to put the GUI code itself. Does that make sense?
Thanks,
Paul

Similar Messages

  • Integrating Another Program Into A Java GUI

    HI
    I have 3 classes here. One is a Java GUI, the other two are involed in
    stripping and processing of information off a webpage.
    Of these latter two classes, one contains a main method which connects
    to a webpage and reads the info off it, it calls the other class which
    parses this information and holds the variables I need to create
    buttons for the main gui!
    Is it possible at all to integrate, the class that reads the webpage,
    into, the Java GUI class.I need to do this to access the variables
    that the parsing class is holding, as previously I have had to create
    an instance of this class in the webpage reader class, but this was no
    good to me as the GUI could not access this information, i.e can I
    create an instance of this stripper at the begining of main in the GUI
    class so as I can use the results for this for producing my buttons?
    I've tried to do this but I am getting unresolved symbol errors. I was
    wondering should I use global variables to hold the needed info also ?
    Any help at all greatly appreciated,
    Thanks
    Gerry

    I did what you're describing. Sounded simple enough. You put the same logic in main() into the applets init() and you can run as app or applet. Worked well in my IDE. Then the troubles start.
    Visit
    http://www.martinrinehart.com
    and read the Article, Launching Applets. That will get you started on launching a Swing application. (Try my Sample, DawnPainter, to give you an idea about how nice this can be when it works.) I promise but don't deliver (yet) an article on the javascript library I wrote that solves all the problems. For non-commercial use you can get your own copy:
    http://www.martinrinehart.com/examples/launchApplet.js

  • Opening HTML file from java GUI

    Can someone please tell me how I can open a HTML file in Internet Explorer from a Java GUI,
    I have an asssignment I am doing for college and I was toying with the idea of putting in helpfiles, for the program, can anyone tell me the easiest way of apcomplishing this???
    Thanks in advance for your help,
    Kaspah

    Although this should answer your question, there are other (cross platform) ways to do what you want. As opposed to your "must have internet explorer" solution. Swing has a built in html viewer you might use, for example. I've been doing some reading on java/xml solutions. I don't consider myself knowledgeable enough (yet) to comment on that solution though. A delimited text file would be another solution. Useing that solution you could treat the file like a set of parrallel arrays on the hard drive and disply your text on pre-formated labels. Anyway, here is a link to you answer......
    http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Runtime.html#exec(java.lang.String)
    Ron_W

  • JAVA GUI project

    I want to make a JAVA GUI program, it must do the next things.
    1) Input right answers
    (You have a text file with the right answers. Let's say the following 10 right answers in a text file: answer.txt --->[y?nyyyyn??]---> ?= you don't no the answer
    2) Input right answers of the student's.
    Example
    20026830 [nyn?nynnyn]
    20029321 [nn???yyyny]
    3) View the results.
    Per student you get the result of how many question's where right, wrong, ?=(didn't no)
    Who can help me.....!!!
    Greetings,
    Ronnie

    ...perhaps this will help you a bit:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=338071&tstart=100&trange=100

  • Next release of Java gui?

    Hallo,
      I use java GUI under Linux. I have some issues with current release, but I am not able to create bug reports (too busy on project). I hope that anybody does it, so I wonder if any dotted release has been released with cursor positioning fixed, or, if new release 7.20ver.3 will be released soon. I temporary use 7.20 rev2 for programmimg, but I need to switch to 7.10 when I need to change screen design in screen painter.
    Thank you for answer,
    Pavel

    Hallo Rolf-Martin,
      I've found two distinct problems:
    1)
    Run se51, select a window and edit layout (without graphical screen painter, of course). Try to move an object, e.g. from n-th column to m-th column. I.e. click to this object, click to "Block" button, select new position (best for this example is to select empty line, and try to move object to m-th column, where m > 1. Clicking to "Move" button results to move object to rught line, but to its first column! If start of this line is occupied by another object, it will lead to error - conflict between objects.
    This problem can be easily reproduced. This problem disappear when I use gui 710 on 32-bit platform (chrooted environment on my workstation).
    2)
    Sometimes  - and I cannot describe what is neccessary to do to reproduce it - moving mouse cursor over menu or history of field will lead to unexpected behavior: wrong popup menu is shown, it looks like gui "things" that mouse is placed at position [x,y-3cm] instead of [x,y]. When I want to use history, it leads to hiding of historical values instead of using selected one. But when I note that selected line (from history of field) is not selected by pointing mouse to it, I move mouse right until color of selected value is changed ... and then click works as expected ... but mouse custor is often pointing out of this history menu.
    This problem is hardly reproduced, workaround is to close session or log off from system and log on again.
    Thank you for your help,
      Pavel

  • Java GUI for a shell script

    I have a file with passwd format.I made a script for this file that is working as I wanted it to work.I have a list of options and each time I give an option,the script is doing something(for example,if I press "b" it makes something and if I press "a" it makes something else).All the results are an output from the file.
    My question is how can I create a GUI in java for this script.For example if I want the script to do what it would do if I pressed the "a" button on my keyboard,but not by pressing "a",but by choosing from a drop down list or some other graphical feature(by ticking a check box,clicking a button etc).Can I do this with java?
    Lazaros

    Hi,
    I understand you can create a Java Swing gui for a bash shell script which takes both complex input and writes output to the stdout & files, to be specific. Is that correct?
    If yes, could you give a simple example. Say for the following shell script.
    #!/bin/sh
    printf "Enter input\n"
    i=0
    while [ $i -ne 1 ]; do
    read $inputVar
    if [  "$inputVar" == "y" ]; then
    printf "You typed yes\n"
    i=1
    elif [  "$inputVar" == "y"  ]; then
    printf "you typed no\n"
    i=1
    else
    printf "Enter a valid character\n"
    i=0
    fi
    done
    Could you also point to some URL's which might help? Googling for "Java Gui for shell script" returns this as the first page, others dont really help. Googling "GUI for shell script" returns all other gui toolkits for xes but thats not what I want. I want a cross platform (nixes, Win*, MacOS* ) gui for a shell script ( which I plan to run using cygwin etc).
    TIA
    Vinod

  • Can I Open an HTMLHelp (*.CHM) File from Java GUI Application?

    I ussually use Delphi to develop my applications and I can open an HTMLHelp (*.CHM) file from my application. Can you show me the ways to do it from my Java GUI applications?
    Thanks for everyone.
    Budi Raharjo
    http://budiraharjo.blogspot.com

    http://www.google.com/search?q=java+chm
    Seems like there is some 3rd party software available for that.

  • New Features for Java GUI

    Hello everyone!
    Can anybody tell about new features in SAP GUI for Java. I think It's emasculate now. It doesn't contain New ABAP editor, Network graphic, normal Screen Painter... I really enjoy adding themes and other stuff, but when these functionality will be added?
    Thanks.

    Hi,
      I use Java GUI from version 6.40, so i didn't know new ABAP editor for years. Once somebody shows me its features ...and I found that it is really good editor compared with previous Notepad-like frontend editor. But I have to say that customized version od Gvim used as external editor is in 90% better then new ABAP editor (the only problem is that double click on object doesn't work, but some workarounds are known for double-click on locally defined objects).
    Graphical screen painter is generally good tool, but once I cannot find any feature (sorry, I forgot which one, it happens about 6 years ago). I ask a SAP guru sitting near me. He comes, switch graphical screen painter off and click to a box in non-graphical version of screen painter. Then he told me that some features are not accessible in graphical screen painter. It was last time I used graphical version of screen painter.
    Themes? Works .... at least for me (Linux 32 bit and now Linux 64 bit too).
    So I think that Java GUI is usable (at least on Linux/Mac, I am not sure how in works under Windows) but you cannot stick on all features (and maybe you can find better working variants of it). E. g. I have no problem with new ABAP editor, it would be much better for me, if I can open external editor clicking to "Change" button in SE38 directly instead of click plus selecting external editor from menu.
    Regards,
      Pavel

  • JAVA GUI window content does not fill out when window is enlarged (Win,Mac)

    I've been using the SAP JAVA GUI on a Windows XP workstation as well as a couple of MacBooks running OS X over the last year and a half or so, running versions from 7.10 r 7(maybe earlier) thru 7.10 r 10 (installed today.) The GUI has performed generally well on these platforms, but has one major irritation.
    When I open certain pop-up windows, such as the SPAD [List of Output Requests > Status Description |http://img171.imageshack.us/i/screenshot20091006at241.png/|screenshot], it usually does not open a  large enough window to display all the data - one must scroll horizontally and/or vertically to see the entire window content.  The real aggravation is that if [one enlarges the window|http://img101.imageshack.us/i/screenshot20091006at242.png/|screenshot] so as to see more data, the resizing is ignored.  The contents of the window are still displayed within the original window boundaries instead of filling out the expanded window.   It is not possible to get the entire window contents displayed, it is still necessary to scroll around.
    What am I missing here?   How can I get window resizing to work correctly?   (Or is there a way to make such windows at least open up at a larger initial size??)
    I only found one other thread in this forum, Sap gui screen size in ubuntu., which seemed to be addressing the same problem, but the suggestion was to apply the latest patch to the GUI and get JAVA 1.6.   One would think that since that post in 2008, any patches would have made it into the latest revisions.  I'm already running Java 1.6.
    SAPGUI for Java 7.10 rev 10
    (Version ID 071000041000)
    Tue Sep 8 09:49:53 MEST 2009
    uw1059, 710_REL, 1093492
    Java VM: Apple Inc. Version 1.6.0_15
    OS: Mac OS X(i386) Version 10.6.1
    SAPGUI for Java 7.10 rev 10
    (Version ID 071000041000)
    Tue Sep 8 09:49:53 MEST 2009
    uw1059, 710_REL, 1093492
    Java VM: Sun Microsystems Inc. Version 1.6.0_15
    OS: Windows XP(x86) Version 5.1
    Any suggestions?  Anyone else even seeing this?
    Thanks!
    Rich

    I'm now running
    SAPGUI for Java 7.10 rev 11
    (Version ID 071000041100)
    Tue Dec 8 16:04:41 MET 2009
    uw1059, 710_REL, 1119101
    Java VM: Apple Inc. Version 1.6.0_17
    OS: Mac OS X(i386) Version 10.6.2
    I've also updated my XP system to 7.10 rev 11 and both continue to display the same failure to resize corrrectly.  
    Here's a [video capture of this behavior|http://img163.yfrog.com/i/sapresizebug.mp4/].
    Given that installs on two separate operating systems have consistently misbehaved like this, I have a hard time believing it is something  we are doing.  (But not that hard...)  I find it hard to believe that is the way these screens present on most SAP sites...
    Any comments or suggestions would be welcome!
    Rich

  • Cannot connect a Java GUI client to an EJB

    I am having problems trying to make a Java GUI client connect to an EJB. I am using JRun4.
    At first, I tried making the Java GUI client a part of the enterprise application that I am building (of which the EJB is a part of). I included the client as a Java module in the application.xml of the enterprise application.
    However, when I try to start the server, containing this application, I get an error saying:
    Application authentication required. Incorrect method call.
    Now when I try to execute the application from the console, it works fine except when it comes to the part when it has to connect to the EJB. At this point I get an java.lang.reflect.UndeclaredThrowableException. Here's the stack trace:
    java.lang.reflect.UndeclaredThrowableException
    at $Proxy1.create(Unknown Source)
    at mds.Caller.actionPerformed(Caller.java:135)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(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.pumpOneEventForHierarchy(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)
    Caused by: jrun.ejb.invocation.ContainerNotFoundException: The EJB container for boss-ejb#Boss could not be found.
    at jrun.ejb.invocation.AbstractInvocationProxy.findContainer(AbstractInvocationProxy.java:58)
    at jrun.ejb.invocation.LocalInvocationProxyImpl.invoke(LocalInvocationProxyImpl.java:53)
    at jrun.ejb.invocation.ClientInvocationHandlerImpl.invoke(ClientInvocationHandlerImpl.java:198)
    ... 25 more
    Since the bean is local, I am using a local reference to the bean in the lookup in the code of the client:
    Object o = context.lookup("local/BeanTest")
    I tried to use:
    Object o = context.lookup("java:comp/env/ejb/BeanTest")
    and added an ejb-local-ref in the application-client.xml file of the client. But when I try executing the client in this case, I get an error saying:
    No such binding: ejb
    I wish someone can help me out with this. My main aim is to get the app client talk to the EJB. Thanks a lot in advance.
    Soham

    I am not sure of a tool to view the JNDI tree. I have one in Weblogic console. But you can check the JNDI names with a small sample code.
    import java.util.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    public class TestEnvironment {
        public static void main(String[] args) {
            Context context   = null;
            Object object     = null;
            // Hashtable for environment properties.
            Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            env.put(Context.PROVIDER_URL, "t3://localhost:7001");
            try {
                context   = new InitialContext(env);
                NamingEnumeration enum = context.listBindings("");
                while (enum.hasMore()) {
                    Binding binding = (Binding) enum.next();
                    System.out.println("Name: " + binding.getName());
                    System.out.println("Type: " + binding.getClassName());
                    System.out.println("Value: " + binding.getObject());
            } catch (Exception exception) {
                exception.printStackTrace();
    }Hope this helps.

  • SAP Java Gui in Solaris 10 x86.

    Who run the Java Gui in Solaris 10 x86?
    After I installed Java Gui in Solaris 10 x86 and run guilogon, when I connect the server I created, I got the error message:
    Attempt to load shared library /opt/SAPClients/SAPGui7.00/binlibJPlatin.so failed.
    The library file exists, so either the program
    don't has the privileges to access the library
    or the library is not loadable by the shared object loader
    Technical information:
    Error location: GuiJniLoader.loadPlatinLibrary()
    Error message: /opt/SAPClients/SAPGUI7.00/bin/libJPlation.so:ld.so.1:java:fatal:/opt/SAPClients/SAPGUI7.00/bin/libJPlatin.so:wrong ELF data format:ELFDATA2MSB
    After I confirm the dialog, another error message appears:
    JniAgiLibAdaptor.<init>: Cannot load JNI library.
    I checked the supported OS, it doesn't contains Solaris 10 X86, but I think Solaris 10 was open source, just like linux, why doesn't SAP Java Gui support Solaris 10 X86? And now , how can I solve this problem?

    What you see is what happens when the Java runtime running on Solaris 10 x86 tries to load a library which is compiled for SPARC.
    Because of the native parts in SAP GUI for Java, compilations and installers are required for each OS - HW combination.
    The supported platforms can be seen in SAP note 954572. For Solaris only SPARC is currently supported.
    Because of the effort needed for compiling, testing, support etc. it is required to focus on OS - HW combinations widely used on desktop machines and Solaris 10 on x86 currently does not seem to be one of those.

  • Cannot read list of frontend printers - Printing in SAP JAVA GUI for MAC

    Hello,
    I am trying to print a Spool request in SAP Java GUI 7.10. I am working on Apple with OSX operating system. I get this error message -
    " Cannot read list of frontend printers " - Message no. PO781
    What do i need to do to take a print out from SAP on my Mac.
    Thanks
    Buddy

    Hello,
    which printing access method you are using?
    You might want to have a look at [note 821519|https://service.sap.com/sap/support/notes/821519].
    Best regards
    Rolf-Martin

  • How can I run C programs under a Java GUI?

    Hi
    I'm looking for some info on how to run a command line program written in another language behind a Java GUI, any advice greatly appreciated, particularly in how to transfer data between the two.
    Thanks

    Runtime.getRuntime().exec(...)
    Transfering info is more complicated. Maybe write and read status from disk?

  • How to invoke Outlook Express to send mail in a JAVA GUI

    hi..
    i want to send a mail thru a java GUI...but when i press submit button..it has to invoke MS Outlook express and send the mail via this.
    pls reply soon..
    bi..

    Hi,
    When I execute the command like "Runtime.getRuntime().exec("cmd /c start mailto:[email protected]?subject=Test&body=Hello");" in my java program,There is no boby in my outlook window .could you give me some suggestion? Thank you very much!
    source:
    import java.io.IOException;
    public class TestAutoSendEMail {
         public static void main(String[] args) {
              try {  
                   Runtime.getRuntime().exec("cmd /c start mailto:[email protected]?subject=Test&body=Hello");
         catch (IOException ex) {  
         System.out.println(ex.getMessage());
    }

  • Simple Java DB example

    I am using Java 1.6 and Eclipse Galelio on Vista, Do I need to configure anything is there any story of setting path?
    How to check my Java DB is working or not or everything is fine or not?
    I found many totorial with simple Java DB example but they seem dealing with previous version of JDK, I guess SUN too on http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/ , kindly provide me the simplest example which uses Java DB.
    I am not able to figure out the whole thing of JAVA DB , how it works, in plain language I want to know is there any way of interacting with database from Command prompt? If so how?

    When I am running a simpleApp.java
    I am getting this error:
    Unable to load the JDBC driver org.apache.derby.jdbc.EmbeddedDriver
    Please check your CLASSPATH.
    java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at SimpleApp.loadDriver(SimpleApp.java:414)
         at SimpleApp.go(SimpleApp.java:125)
         at SimpleApp.main(SimpleApp.java:93)
    ----- SQLException -----
    SQL State: 08001
    Error Code: 0
    Message: No suitable driver found for jdbc:derby:derbyDB;create=true
    SimpleApp starting in embedded mode
    SimpleApp finished

Maybe you are looking for

  • I purchased a new Iphone 5s but I can not get the voice mail to work. How do I set up voice mail?

    How can I set up voicemail on my new Iphone 5s? When I touch the icon I get a message for a 10 digit # to call another phone with a mailbox. How can I set up a mailbox on my phone?

  • How to find out email id from CUA ?

    Hi, I would like to have a list of user id with email from CUA. Is there any table/report from where I can get both ? All users are maintained with user id and email into SU01. Thanks...

  • Flash not working in Opera 9.5

    Does someone know how tro fix this ? Win xp pro Downloaded the latest opera 9.5 and the latest Flashplayer 9.0, It doesn't want to work if i step down to opera 9.24 no probs.... Can't find any info on the net, Pretty sure i'm not the only one.. Thank

  • Custom page VO not getting refreshed.

    Hi, I developed a custom page where the user can update the details. Everything works fine and even the updates are done correctly but unless i logout and login, i don't see the changes in the fields the user has done. Why is it happening? Please upd

  • HT4314 Why wont apple let you disable or unregister from gamecenter!? why?

    Why wont apple let you disable or unregister from gamecenter?! Iv done everything I can but games log into it reactivated its notifications aswell. It auto logs me back in...I want apple to let you unregister completely why not?? I have disabled all