Problems with GUI...

I have written a simple Application...
If I break the JFrame and JPanel into 2 different classes
Everything is normal when I launch the Application at console....
But if I launch the Application with Java Web Start..
I just saw a blank window appearing with no errors...
could someone help me find what the problem is?
Thanks......

Thanks for your help...
when I run it with "java -jar xxx.jar"..
It works well...
I have found what the problem is..
It happened because of the icon...
Anyway, Thanks ^_^

Similar Messages

  • Problem with GUI in applet

    Hai to all,
    I am having a problem with GUI in applets
    My first class extends a JPanel named A_a
    import javax.swing .*;
    import java.awt.*;
    import java.awt.event.*;
    public class A_a extends JPanel
    JButton jb;
    JTextArea text;
    public A_a()
    setLayout(new FlowLayout());
    jb=new JButton("Click me");
    //add(jb);
    text=new JTextArea(5,20);
    add(text);
    public void text_appendText(String aa)
    System.out.println("I AM IN A_a");
    text.append(aa);
    text.revalidate();
    revalidate();
    /*public static void main(String ags[])
    A_a a = new A_a();
    JFrame frame=new JFrame();
    frame.getContentPane().add(a);
    frame.pack();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    frame.setSize(200,200);
    frame.show();
    and then I am using other class B_b which is an applet carries a exitsing panel (A_a) inside it .
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class B_b extends JApplet
    public A_a a;
    public void init()
    a=new A_a();
    getContentPane().add(a);
    public void text_appendText(String aa)
    final String aaa =aa;
    new Thread(new Runnable()
    public void run()
    a=new A_a();
    a.setBackground(new java.awt.Color(255,200,200));
    System.out.println("I AM IN B_b");
    a.text.append(aaa);
    a.text.revalidate();
    getContentPane().remove(a);
    resize(500,500);
    }).start();
    and the I am using the second applet C_c in which by performing a button action the old panel A_a should get removed and replace the new panel D_a (which is not here )in the applet B_b with all other components(namely button , text fields etc)
    import javax.swing .*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    public class C_c extends JApplet implements ActionListener
    JButton jbt;
    JTextArea jta;
    public void init()
    getContentPane().setLayout(new FlowLayout());
    jbt=new JButton("Click me");
    jbt.addActionListener(this);
    getContentPane().add(jbt);
    jta=new JTextArea(5,20);
    getContentPane().add(jta);
    public void actionPerformed(ActionEvent ae)
    Enumeration e = getAppletContext().getApplets();
    Applet applets = null;
    while(e.hasMoreElements())
    applets=(Applet)e.nextElement();
    if ( applets instanceof B_b)
    System.out.println("I AM CLASS C_c");
    ((B_b)applets).text_appendText(jta.getText());
    ((B_b)applets).remove());
    ((B_b)applets).getContentPane().add(D_d);
    both the applets C_c and B_b are in same browser page
    How can i achive that pls help .

    Just to make the code readable...
    import javax.swing .*;
    import java.awt.*;
    import java.awt.event.*;
    public class A_a extends JPanel
    JButton jb;
    JTextArea text;
    public A_a()
    setLayout(new FlowLayout());
    jb=new JButton("Click me");
    //add(jb);
    text=new JTextArea(5,20);
    add(text);
    public void text_appendText(String aa)
    System.out.println("I AM IN A_a");
    text.append(aa);
    text.revalidate();
    revalidate();
    /*public static void main(String ags[])
    A_a a = new A_a();
    JFrame frame=new JFrame();
    frame.getContentPane().add(a);
    frame.pack();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    frame.setSize(200,200);
    frame.show();
    }and then I am using other class B_b which is an applet carries a exitsing panel (A_a) inside it .
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class B_b extends JApplet
    public A_a a;
    public void init()
    a=new A_a();
    getContentPane().add(a);
    public void text_appendText(String aa)
    final String aaa =aa;
    new Thread(new Runnable()
    public void run()
    a=new A_a();
    a.setBackground(new java.awt.Color(255,200,200));
    System.out.println("I AM IN B_b");
    a.text.append(aaa);
    a.text.revalidate();
    getContentPane().remove(a);
    resize(500,500);
    }).start();
    }and the I am using the second applet C_c in which by performing a button action the old panel A_a should get removed and replace the new panel D_a (which is not here )in the applet B_b with all other components(namely button , text fields etc)
    import javax.swing .*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    public class C_c extends JApplet implements ActionListener
    JButton jbt;
    JTextArea jta;
    public void init()
    getContentPane().setLayout(new FlowLayout());
    jbt=new JButton("Click me");
    jbt.addActionListener(this);
    getContentPane().add(jbt);
    jta=new JTextArea(5,20);
    getContentPane().add(jta);
    public void actionPerformed(ActionEvent ae)
    Enumeration e = getAppletContext().getApplets();
    Applet applets = null;
    while(e.hasMoreElements())
    applets=(Applet)e.nextElement();
    if ( applets instanceof B_b)
    System.out.println("I AM CLASS C_c");
    ((B_b)applets).text_appendText(jta.getText());
    ((B_b)applets).remove());
    ((B_b)applets).getContentPane().add(D_d);
    }

  • Design Problem with GUI sub vi

    Hello community,
    in general, I would like to separate the GUI from the data, but I get
    a problem with this design approach in LabView:
    I often have sub VIs that are supposed to control something.
    Therefore, these VIs consist of a control loop. A GUI window should
    show the regulation process (showing how the tracking error is
    hopefully approaching zero etc.). As I said, this GUI should be a
    separate VI (separate from the control loop VI). Since the GUI has to
    be updated on each sample, it is clear that the GUI VI should be
    inside the control loop, and therefore, it should be a sub VI of the
    control loop VI.
    Now, the problem is that the control loop VI itsself is a sub VI
    because the whole regulation is just a subsystem of the whole program
    (The main VI doesn't have a GUI, but first starts a (GUI) input mask
    for the same reason: separate the GUI from the rest).
    But back to the GUI VI inside the control loop. I must check the 'Show
    Front Panel When Called' option. But I can't check the 'Close
    Afterwards if Originally Closed' option since the GUI VI would appear
    and disappear in the control loop - according to the loop's sample
    rate. However, if I don't check the 'Close Afterwards if Originally
    Closed' option then the GUI VI will continue to show, even after the
    control process is finished.
    So in other words: I need the possiblity to close the GUI VI
    programatically, after the control process is finished.
    Any ideas?
    Regards
    Johannes

    Hi tmh,
    thanks for your answer
    On Tue, 11 Nov 2003 10:26:32 -0600 (CST), tmh wrote:
    >I think you're on the wrong track trying to put your 'GUI VI' inside
    >your control loop. It might be a better design to have the control and
    >GUI handled by separate loops and use an appropriate method to pass
    >data between the two, e.g. a global variable to pass the setpoint from
    >GUI to control...
    I try to avoid globals. Now, suppose I had multiple unrelated control
    loops. I had to suppose a global variable for each of these
    subsystems. I already use globals for the GPIB device IDs. I wouldn't
    like more.
    >and a queue to pass readings from control to GUI. In
    >fact, you could even split the GUI into two loops: one to read user
    >input from the front pa
    nel controls and one to display data returned
    >by the control loop.
    But if I split the GUI: How can I view them simultaneously? The user
    must see input and output simultaneously, in one window.
    >You may find it's more convenient to make the GUI
    >the top-level VI and make the control loop a subVI of that (but
    >outside the GUI loops).
    Your approach sounds interesting. Is there a sample for this
    architecture in the examples?
    Anyway, I have to point out that I have several unrelated GUI windows
    in my application. There is no notion of a main GUI in my application.
    The control loop is just one feature of my application, so it doesn't
    make sense to use the control GUI as the top-level VI. At application
    startup a user input form is displayed (it also has some sort of menu
    selection). But even this window can't be toplevel since it provides
    an Option radio button (that shows and hides controls, accordingly) a
    CONTINUE button, and a STOP button which implies that the input
    form.vi must be
    in a loop.
    The problem is that I can't send messages to windows in LabView as I
    am used to in Win32/VC++.
    Johannes

  • JDeveloper Problem with GUI

    Hi All,
    I'm running JDev 3.1 on Win2000, and I'm having a bit of a problem with redraws of the GUI.
    When I click anywhere on the JDev GUI and trigger and action that involves a GUI redraw the little piece of the GUI under the mouse pointer graphic is not redrawn. It does not effect the functionality but it is annoying and will make the other developers I work with less keen about using it.
    Does anyone else have this problem? Is it a JDev or Win2k problem?
    Cheers
    d

    Probably an issue with the JRE used by JDev. on Win 2k. Have you tried 3.2x? I haven't seen that type of issue with it on Win 2k.

  • BEx Analyzer 3.x language problem with GUI 710

    Hi All,
    We are having trouble to login to BEx Analyzer 3.x with GUI 710 with English language, even if we set language as EN in the logon pad by default it is logging into Japanese language. But 7.x Analyser is working fine.
    We have BI 7.0 and BW 3.5 systems. 
    SAP GUI 710 installed with latest available Frontend Patch ( bi710sp10_1000-10004472 , gui710_15-10002995 and bw350gui710_7-10004473 ) and we are using Excel 2003 on XP Professional.
    Installed .Net Framework 2.0, Microsoft office patch - office2003-KB907417
    Your help is very much appreciated.
    Regards,
    MKR

    Hi,
    Are you using different backend systems to connect for 3.x and 7.x? Because the file which prompts the SAP Logon is a common file used by both 3.x and 7.x.It shouldn't behave differently for the same system.
    You can uninstall the SAPGui and Front End patch and then reinstall it.
    The BW 3.5  patch  8  in SAP GUI 7.10 is released to the SMP now and is available for download.
    Rgds,
    Murali

  • Problem With GUI ( Who can help me! )

    Hallo,
    It�s a very simple program to See the Clock on a panel. The program works well, but if I want to include a GUI to my program, it don�t want. I use runable action and I think that is be the problem.
    Here below you can see the code�s. I�m sure there is someone who can help me.
    Thanks a lot,
    Seyyed
    The code:
    public class Clock_maken extends java.applet.Applet
    implements Runnable {
    public volatile Thread clockThread = null;
    JLabel           Datuum_label;
    DateFormat      formatter;
    Locale           locale;
    Date           currentDate;
    String          today;
    public void init(){ 
    locale = Locale.getDefault();
    Datuum_label = new JLabel("date");
    public void start() {       
    Datuum_label.setForeground(Color.black);
    add(Datuum_label);
    if(clockThread == null) {
    clockThread = new Thread(this);
    clockThread.start();
    public void run() {
         Thread myThread = Thread.currentThread();
         while (clockThread == myThread) {
         currentDate = new Date();
    formatter =                     DateFormat.getDateTimeInstance(DateFormat.FULL,
              DateFormat.MEDIUM, locale);
    today = formatter.format(currentDate);
    Datuum_label.setText(today);
    try {
    Thread.sleep(1000);
    } catch (InterruptedException e){ }
    public void stop() {clockThread = null;}
    public static void main(String[] args){
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame      lunarPhasesFrame = new JFrame("Lunar Phases");
    lunarPhasesFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Clock_maken phases = new Clock_maken();
    phases.init();
    phases.start();
    lunarPhasesFrame.pack();
    lunarPhasesFrame.setVisible(true);
    Now i want to create a GUI like folowing, but it dont work. Do u know wat is de probleem of mijn prograam.
    private static void createAndShowGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true);
         /*     JFrame      lunarPhasesFrame = new JFrame("Lunar Phases");
              lunarPhasesFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    */ Clock_maken phases = new Clock_maken();
         /*     phases.init();
              phases.start();
              lunarPhasesFrame.pack();
         lunarPhasesFrame.setVisible(true);*/
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }

    Continued here, with formatted code:
    http://forum.java.sun.com/thread.jspa?threadID=725022

  • Please help problem with GUI

    Hi
    I have two problems firstly when i try to assign a method to a button to a GUI
         JButton SetPrice = new JButton ("Set Price");
            contentPane.add( SetPrice);
             SetPrice.addActionListener(new ActionListener() {
                                   public void actionPerformed(ActionEvent e) {  SetPrice ();    }This is teh code i am using to set up teh button on teh display.Belwo is the method it should run.
    public double SetPrice( int price)
             if (price <= 199.9){
           Cost= price;
             return Cost;
            else {
              System.out.println ( "Set a price which is less than 199.9");
              return Cost; }
            }When i try to compile it comes up with when i comipile
    SetPrice (int) in Shop cannot be applied to ()The variable has type double.So pelase my someone show me how to make the action listener button run this method.
    Thanks

    JButton SetPrice = new JButton ("Set Price");
            contentPane.add( SetPrice);
             SetPrice.addActionListener(this);
    SetPrice.setActionCommand("setprice");
    public void actionPerformed(ActionEvent e) {
    String action=e.getActionCommand();
    if(action.equals("setprice") {
    //do something
        }

  • SOS Problem with GUI login

    Please answer me as fast as you can because I have the following serious problem:
    I had install the SAP WEB AS 6.10 (and SAPDB) test version which I took it from the book ABAP OPJECTS THE OFFICIAL REFERENCE. Unfortunatelly, it did not work well when I was off line of the network of my company, I also installed the network adapter of MS LOOPBACK (as the instructions are saying) but again I couldn't login, so I uninstall from my PC the SAP WEB AS. Next day when I went to my company I could not logon to SAP and the error message is: SERVICE 'SAPDP00' UNKNOWN. I check the fileservice which is under the directory C:\WINNT\SYSTEM32\DRIVERS\ETC and there is a line with SAPDP00 3200/tcp. I reinstall GUI 7 times but the problem still exists.
    Well I hope that I will find a solution during weekend because if not I will forced to format my pc and reinstall all my aplication, sth which is very painfull.
    My pc is working with WinXP SP1.
    The error details are:
    service 'sapdp00' unknown
    time: Sat Jul 03 10:51:16 2004
    component: NI(Network Interface)
    release: 620
    version: 36
    module: ninti.c
    line: 428
    method: NiPServToNo
    return code:  -3
    System Call: getservbyname
    counter: 1
    Message was edited by: s0003198291

    Finally I found what cause this problem and the temporary solution plus the permanent one.
    My PC was hit by a virus (new version of QHOSTS-1 see at the end) which is changing the registry file HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
    "DatabasePath"= %SystemRoot%\nsdb
    So it is creating a host file under C:\WINNT\NSDB which it put it to the registry.
    So the permanent solution is to change the Registry.
    The temporary one is to run the following command from the dos:
       sapgui /H/<address of the SAP server>/S/3200.
    You can find more information on:
    http://www.sapfans.com/forums/viewtopic.php?t=83386&highlight=servicesapdp00unknown
      Information about the virus you can find in:
    http://vil.nai.com/vil/content/v_100719.htm
       Thanks

  • Having problems with GUI

    Goodday all, I'm having a problem getting this GUI for a simulation game up and running. I've added four panels which each house components for instance buttons, text area etc. And I've created another panel to house the image that should be set for the background. I've heard that the best way to achieve this is to use getLayeredPane(), but I think that's the problem. The panel simDisplay holds the title for the simulation, simControls hold start and stop simulation buttons, simGrid holds a grid on which the simulation is played (still working on that) and simDisplayControls is a panel that holds a textArea and button to run the simulation again. The textArea is a display area for the status of the simulation (for instance which characters moved, how many are there remaining etc ). The simDisplay was placed NORTH, simGRID CENTER, simControls EAST, and simDisplayContols SOUTH. Before I added the getLayeredPane so that I can view the image as the background, each of these panels were in their respective positions within the layout...now that I have, only some components are visible. As soon as I comment out that line of code with getLayeredPane all the components show exactly how I want them to which is in the positions I specified above (NORTH, SOUTH etc). I'm wondering if the fact that I used the BoxLayout to position the components within their panels is conflicting with the layeredPane. I'm new to this so any help will be greatly appreciated. Thank You ;)
    import javax.swing.*;
    import java.awt.*;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    public class Simulation extends JFrame{
    //create new panels, image icons and buttons
    JLayeredPane panel = new JLayeredPane();
    JPanel panel2 = new JPanel();
    JPanel simDisplayControls = new JPanel();
    public JButton start = new JButton("Start Simulation");
    public JButton stop = new JButton("Stop Simulation");
    private JTextArea turnDisplay;
    public JButton next = new JButton("Next Time Step");
    JPanel simDisplay = new JPanel();
    JPanel simGrid = new JPanel ();
    JPanel simControls = new JPanel();
    //GUI main function
    public static void main(String[] args){
    Simulation example = new Simulation();
    //GUI constructor
    public Simulation() {
    BorderLayout b = new BorderLayout();
    setLayout(b);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    BorderLayout panelout = new BorderLayout( 0, 0 );
    panel.setLayout(panelout);
    //Set image as simulation background
    ImageIcon myIcon = new ImageIcon("background2.jpg");
    JLabel picLabel = new JLabel(myIcon);
    panel2.add(picLabel);
    picLabel.setBounds(0, 0, myIcon.getIconWidth(), myIcon.getIconHeight());
    getLayeredPane().add(picLabel, new Integer.MIN_VALUE);
    panel.setOpaque(false);
    //set content pane to main panel containing all other panels
    setContentPane(panel);
    simGrid.setLayout (new GridLayout (20, 20));
    // create text area to display status after each time step of the simulation
    turnDisplay = new JTextArea("Doodlebug Turn", 10, 40);
    JScrollPane scrollingDisplay = new JScrollPane(turnDisplay);
    simDisplayControls.add(scrollingDisplay);
    turnDisplay.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    //create horizontal box to house status display and "next time step" button
    Box simDisplayBox = Box.createHorizontalBox();
    simDisplayBox.add(Box.createHorizontalGlue());
    simDisplayBox.add(turnDisplay);
    simDisplayBox.add(Box.createHorizontalStrut(40));
    simDisplayBox.add(next);
    simDisplayBox.add(Box.createHorizontalStrut(30));
    //create vertical box to house "start" and "stop" simulation buttons
    Box simControlBox = Box.createVerticalBox();
    simControlBox.add(Box.createVerticalStrut(80));
    simControlBox.add(start);
    simControlBox.add(Box.createVerticalStrut(60));
    simControlBox.add(stop);
    simControlBox.add(Box.createVerticalGlue());
    //create label containing the title of the simulation
    JLabel title = new JLabel("Sim Title");
    //add title label and box containing simulation control buttons to their respective panels
    simDisplay.add(title);
    simControls.add(simControlBox);
    //add box containing status display and "next time step" button to its coresponding panel
    simDisplayControls.add(simDisplayBox);
    //add panels to the main panel
    panel.add(simDisplay, BorderLayout.NORTH);
    panel.add(simGrid, BorderLayout.CENTER);
    panel.add(simControls, BorderLayout.EAST);
    panel.add(simDisplayControls, BorderLayout.SOUTH);
    //set size of the frame
    setSize(800, 700);
    setVisible(true);// make the frame visible
    }

    Don't put the image on the layeredpane, and in fact don't create a class that subclasses JFrame. You're far better off subclassing a JPanel and drawing the image in the JPanel by overriding its paintComponent method, calling drawImage(...) in the same paintComponent method after checking that the image isn't null. Then adding all of your components to this JPanel. Be sure that the JPanels sitting on top of the main JPanel all have their opaque property set to false.
    Then when you're ready to show the app, create a JFrame on the fly, place your JPanel into the JFrame's contentPane, pack the JFrame, set it's location, and show it.
    for instance:
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.URL;
    public class Simulation extends JFrame
      //TODO: change this to point to your desired background image
      private static final String BACKGROUND =
        "http://upload.wikimedia.org/wikipedia/" +
        "commons/8/8e/Nebelostfriesland.jpg";
      JPanel panel = new JPanel()
        protected void paintComponent(Graphics g)
          super.paintComponent(g);
          myPaint(g);
      private BufferedImage image;
      private void myPaint(Graphics g)
        if (image != null)
          g.drawImage(image, 0, 0, panel.getWidth(), panel.getHeight(), panel);
      public Simulation()
        try
          // or if using a file on disk, can use a File here or an InputStream
          image = ImageIO.read(new URL(BACKGROUND));
        catch (IOException e)
          e.printStackTrace();
        panel2.setOpaque(false);
        //panel.setOpaque(false);
        simGrid.setOpaque(false); // etc...
    }Edited by: Encephalopathic on Dec 1, 2008 3:23 PM

  • Problem with GUI/logic

    This is really tough to explain, but here goes:
    I have a project that consists of three classes --
    1) a container (JFrame) that holds a number of JButtons and JText fields;
    2) a processing engine that handles the actions from the buttons;
    3) an object class that is a big piece of what gets displayed based on the buttons that get pushed.
    My "public static void main" is in the processing engine. All the "main" does is create an instance of the container. But the processing engine also contains the actionPerformed subclass for the buttons.
    The container class instantiates the processing engine and registers the button listeners to it. Push a button and the logic goes to the processing engine. Okay so far.
    The container also instantiates the object class, since that is what needs to be displayed. When the buttons are pushed, the display goes through a variety of changes as buttons are pushed in the correct sequence. Push one button, the object is updated. Push another one, it is updated in another way. The changes must all be reflected on the screen as they occur.
    The problem is, when I respond to the ActionEvent, the processing engine does not have an instance of the object; it has to be passed one from the container class. If I try to instantiate a new object, it will wipe out the old one. If I don't get an instance, I get nullPointers all over the place.
    So my question is: how can I pass the object from one display to the next? How can I display the object, respond to the ActionEvent by changing the object, then redisplay the modified version of the object, when I don't have an instance of the object in the ActionPerformed subclass?
    I can post the code, but it's pretty garbled by repeated attempts to solve this issue.

    Okay. Here are the three classes you requested. I built them in a hurry so there may still be syntax errors and such. But I think you can get the feel of what I'm trying to do. I can explain if not.
    <code>
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class ContainerClass extends JFrame
         JPanel cardP = new JPanel();
         JButton card1 = new JButton();
         JButton card2 = new JButton();
         JButton dealButton = new JButton();
         JButton discardButton = new JButton();
         java.net.URL img1;
         java.net.URL img2;
         ImageIcon cardIcon1 = new ImageIcon();
         ImageIcon cardIcon2 = new ImageIcon();
         JPanel displayPanel = new JPanel();
         JPanel actionPanel = new JPanel();
         ActionClass ac = new ActionClass();
         public ContainerClass()
              super("Welcome to the game");
              GridLayout gl1 = new GridLayout(2, 2, 5, 5);
              setLayout(gl1);
              setSize(1000, 800);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         dealButton.addActionListener(ac);
         discardButton.addActionListener(ac);
         img1 = this.getClass().getResource("image01.gif");
         img2 = this.getClass().getResource("image02.gif");
         card1.setIcon(new ImageIcon(img1));
         card2.setIcon(new ImageIcon(img2));
         cardP.setLayout(new GridLayout(1,2,5,5));
         actionPanel.setLayout(new GridLayout(1,2,5,5));
         cardP.add(card1);
         cardP.add(card2);
         actionPanel.add(dealButton);
         actionPanel.add(discardButton);
         add(cardP);
         add(actionPanel);
         pack();
         setVisible(true);
    </code>
    <code>
    import java.awt.event.*;
    import java.util.*;
    public class ActionClass implements ActionListener
         ContainerClass cc;
         ObjectClass oj;
         public static void main(String[] args)
              ContainerClass cc = new ContainerClass();
         public void actionPerformed(ActionEvent e)
              String command = e.getActionCommand();
              if (command.equalsIgnoreCase("DEAL"))
                   ObjectClass oj = new ObjectClass();
                   ArrayList al = oj.getObject();
                   display(al);
              if (command.equalsIgnoreCase("DISCARD"))
                   // here I need to get the existing object and modify it. But if I
                   // instantiate a new ObjectClass, it may be different than the one I've displayed.
         public void display(ArrayList al)
              // here I need to set the icons on the JButtons in the container class
              // to the images I retrieved from the getObject() method. But if I
              // instantiate a new ContainerClass, it will create a whole new screen.
    </code>
    <code>
    import java.util.*;
    public class ObjectClass
         public ObjectClass()
              // null constructor
         public ArrayList getObject()
              // in reality, this ArrayList would consist of random Strings. However, I've used these limited elements
              // to demonstrate the structure I'm dealing with. The true scope is far greater and far more random. In
              // theory, no two ArrayLists should contain the same elements.
              ArrayList al = new ArrayList();
              String[] element1 = {"Card 1", "Card 2"};
              String[] element2 = {"Color 1", "Color 2"};
              String[] element3 = {"image01.gif", "image02.gif"};
              al.add(element1);
              al.add(element2);
              al.add(element3);
              return al;
    </code>
    That is an extremely pared-down version of what I'm trying to do.

  • ABAP DT for OS X: problems with GUI integration

    Anyone there able to make it work on OS X? Your help will be much appreciated.
    I've tried HANA Studio bundled from SAP, vanilla Juno and Kepler installations with tools.hana.ondemand.com repos and cannot make the SAP GUI integration to work in any of them.
    Every time I select option "Open with SAP GUI" I receive the empty tab and error message in log:
    Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor' from bundle '1154'
    Unhandled event loop exception
    and so on.
    I have to GUIs installed 7.20rev11 and 7.30.

    Now, it works for me.
    Previously I have had updated the Java SE 7 only (Default with java.com site) But the JDK version is needed. I have now installed JDK 1.7-51 and SAPGUI 7.30rev7 and it works fine.

  • Problems with GUI under Windows-NT

    Hi friends,
    I've created a Java-Application which works fine under Windows 2000, Windows XP, Linux and Solaris.
    The only problem I have is with Windows NT.
    When the application starts, the window will open but doesn't display any content. The application is
    working (as I can use keybord-input, keybord-shortcuts and so on), but no display besides an empty
    window...
    I tried different Look&Feels, but no change....
    Do you have any ideas what could be wrong?
    Thanks a lot,
    Chris
    P.S.: JDK is 1.4.2_04

    Try adding the argument -Dsun.java2d.noddraw=true on the launcher.

  • Help problems with gui

    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import javax.swing.*;
    public class TheBEST extends Frame implements ItemListener
    TextField AmmountLabel;
    Label lb1,lb2,lb3,lb4,lb5;
    Label tb6,tb7;
    Label td8,td9,td10,td11,td12;
    Label ct1;
    Label ct2;
    Label ct3;
    Panel p1,p2,p3,p4,p5,p6,p7,p8,p9;
    private Checkbox  StirJcheck,AbcJcheck,OysterJcheck,OldJcheck,ThaiJcheck;
    private double PackagePric = 58.00;
    private final double StirFriedCheck=2.00;
    private final double AbcMango=3.00;
    private final double OystersMombasa=5.50;
    private final double Oldfashioned=2.50;
    private final double Thaihot=4.50;
    public static void main(String[]args){
    TheBEST f=new TheBEST();
    f.setSize(400,200);
    f.setTitle("Restaurant");
    f.setVisible(true);
    public TheBEST()
    Font fV = new Font("Verdana", Font.BOLD,25);
    Font fA = new Font("Ariel",Font.BOLD+Font.ITALIC,13);
    setBackground(Color.pink);
    lb1=new Label("SHAZALEE BISTRO");
    lb1.setFont(fV);
    lb1.setForeground(new Color(255,0,230));
    lb1.setBackground(Color.pink);
    lb2=new Label("Special Package For Today !!");
    lb2.setFont(fA);
    lb3=new Label("Tomyam : (Chicken+Meat+Crab+Fish)");
    lb3.setBackground(Color.orange);
    lb3.setForeground(Color.red);
    lb3.setFont(fA);
    lb4=new Label("Salad Relish with Thousand Island");
    lb4.setBackground(Color.orange);
    lb4.setForeground(Color.red);
    lb4.setFont(fA);
    lb5=new Label("Thai Spicy Tamarind Prawn");
    lb5.setBackground(Color.orange);
    lb5.setForeground(Color.red);
    lb5.setFont(fA);
    tb6 =new Label(" << Additional Order:  >>");
    tb6.setFont(fA);
    tb7 =new Label("Number of person : ");
       tb7.setFont(fA);
       ct1 =new Label("$0.00       ");
       ct2 =new Label("$0.00       ");
       ct3=new Label("58.00");
       AmmountLabel = new TextField(4);
    p1.setLayout(new BorderLayout());
    p1.add("NORTH",lb1);
    p1.add("CENTER",p2);
    p1.add("SOUTH",p8);
    /*p1.add(lb2);
    p1.add(lb3);
    p1.add(lb4);
    p1.add(lb5);
    p1.add(tb6);
    /*setLayout(new BorderLayout());
    add("NORTH",p1);
    add("CENTER",p2);
    add("SOUTH",p3);
    p2.setLayout(new BorderLayout());
    p2.add("NORTH",p3);
    p2.add("CENTER",p5);
    p2.add(tb7);
    p2.add(AmmountLabel);
       p2.setBackground(Color.pink);
    setLayout(new FlowLayout());
    add(p2);
    StirJcheck = new Checkbox("Stir Fried Wide Rice : RM 2.00 per person",false);
    AbcJcheck = new Checkbox("ABC plus Mango Ice Cream with Pistachios : RM 3.00 per person",false);
    OysterJcheck = new Checkbox("Oysters Mombasa : Baked with Garlic Butter:RM 5.00 per person" ,false);
    OldJcheck= new Checkbox("Old Fashioned Banana Pudding : RM 2.50 per person",false);
       ThaiJcheck= new Checkbox("Thai Hot and Sour Shrimp Soup : RM 4.50 per person",false);
    p3.setLayout(new BorderLayout());
    p3.add("NORTH",lb2);
    p3.add("CENTER",p4);
    p3.add("NORTH",tb6);
    p3.setForeground(Color.red);
    p3.setFont(fA);
    p3.add(StirJcheck);
    p3.add(AbcJcheck );
    p3.add(OysterJcheck);
    p3.add(OldJcheck);
    p3.add(ThaiJcheck);
    /*setLayout(new BorderLayout(20,10));
    add(p3);
    td8 = new Label(" ** PRICE ** ");
    td8.setBackground(Color.gray);
    td9 = new Label("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    td10 = new Label("PACKAGE : ");
    td11 = new Label("ADDITIONAL ORDER :");
    td12 = new Label(" TOTAL PRICE : ");
    p4.setLayout(new GridLayout(3,0,0,10));
    p4.add(lb3);
    p4.add(lb4);
    p4.add(lb5);
    p4.setBackground(Color.yellow);
    p4.setFont(fA);
    p4.add(td8);
    p4.add(td9);
    p4.add(td10);
    p4.add(ct3);
    p4.add(td11);
       p4.add(ct1);
    p4.add(td12);
    p4.add(ct2);
    p4.setBackground(Color.GRAY);
    /*setLayout(new FlowLayout(FlowLayout.LEFT,0,20));
    add(p4);
    p5.setLayout(new BorderLayout());
    p5.add("NORTH",p6);
    p5.add("CENTER",p7);
    p6.setLayout(new FlowLayout());
    p6.add(tb7);
    p6.add(AmmountLabel);
    p7.setLayout(new GridLayout(5,0,0,0));
    p7.add(StirJcheck);
    p7.add(AbcJcheck);
    p7.add(OysterJcheck);
    p7.add(OldJcheck);
    p7.add(ThaiJcheck);
    p8.setLayout(new BorderLayout());
    p8.add("NORTH",td8);
    p8.add("CENTER",p9);
    p9.setLayout(new GridLayout());
    p9.add(td9);
    p9.add(td10);
    p9.add(td11);
    p9.add(td12);
    StirJcheck.addItemListener(this);
    AbcJcheck.addItemListener(this);
    OysterJcheck.addItemListener(this);
    OldJcheck.addItemListener(this);
    ThaiJcheck.addItemListener(this);
    public void itemStateChanged(ItemEvent event) {
      double price =0.00;
    double total=PackagePric + price;
    NumberFormat nf = NumberFormat.getCurrencyInstance();
    int addAmount = Integer.parseInt(AmmountLabel.getText());
      if (StirJcheck.getState()) {
      price+= StirFriedCheck * addAmount;
      if (AbcJcheck.getState()) {
      price+= AbcMango* addAmount;
       if (OysterJcheck.getState()) {
      price+= OystersMombasa * addAmount;
      if (OldJcheck.getState()) {
      price+= Oldfashioned * addAmount;
      if (ThaiJcheck.getState()) {
      price+= Thaihot * addAmount;
       ct1.setText(nf.format(price));
       ct2.setText(nf.format(total));
       ct3.setText(nf.format(PackagePric));
    }I get a runtime error what should i do ?

    [url http://forum.java.sun.com/thread.jspa?threadID=770922&tstart=0]Crosspost.

  • Problem with Applets in same page

    Hai to all,
    I am having a problem with GUI in applets
    My first class extends a JPanel named A_a
    import javax.swing .*;
    import java.awt.*;
    import java.awt.event.*;
    public class A_a extends JPanel
    JButton jb;
    JTextArea text;
    public A_a()
    setLayout(new FlowLayout());
    jb=new JButton("Click me");
    //add(jb);
    text=new JTextArea(5,20);
    add(text);
    public void text_appendText(String aa)
    System.out.println("I AM IN A_a");
    text.append(aa);
    text.revalidate();
    revalidate();
    /*public static void main(String ags[])
    A_a a = new A_a();
    JFrame frame=new JFrame();
    frame.getContentPane().add(a);
    frame.pack();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    frame.setSize(200,200);
    frame.show();
    and then I am using other class B_b which is an applet carries a exitsing panel (A_a) inside it .
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class B_b extends JApplet
    public A_a a;
    public void init()
    a=new A_a();
    getContentPane().add(a);
    public void text_appendText(String aa)
    final String aaa =aa;
    new Thread(new Runnable()
         public void run()
              a=new A_a();
              a.setBackground(new java.awt.Color(255,200,200));
              System.out.println("I AM IN B_b");
              a.text.append(aaa);
              a.text.revalidate();
              getContentPane().remove(a);
              resize(500,500);
         }).start();
    and the I am using the second applet C_c in which by performing a button action the old panel A_a should get removed and replace the new panel D_a (which is not here )in the applet B_b with all other components(namely button , text fields etc)
    import javax.swing .*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    public class C_c extends JApplet implements ActionListener
    JButton jbt;
    JTextArea jta;
    public void init()
    getContentPane().setLayout(new FlowLayout());
    jbt=new JButton("Click me");
    jbt.addActionListener(this);
    getContentPane().add(jbt);
    jta=new JTextArea(5,20);
    getContentPane().add(jta);
    public void actionPerformed(ActionEvent ae)
    Enumeration e = getAppletContext().getApplets();
    Applet applets = null;
              while(e.hasMoreElements())
                   applets=(Applet)e.nextElement();
                   if ( applets instanceof B_b)
                             System.out.println("I AM CLASS C_c");
                             ((B_b)applets).text_appendText(jta.getText());          
                             ((B_b)applets).remove());
                             ((B_b)applets).getContentPane().add(D_d);
    both the applets C_c and B_b are in same browser page
    How can i achive that pls help .

    please help me its urgent for my project

  • Burning problem with gneux.exe

    hi, this is the problem with gui can any body suggest me how to download a file with name c:\program Files \sap\frontend\sapgui\gneux.exe its very urgent pls respond immediately

    Hi,
    Do you have the installation CD  with you ?
    Regards
    Sunil

Maybe you are looking for