First GUI help needed - replace JPanel?

Hello guys,
I'm trying to develop my first GUI and I'm using Netbeans to create the GUI
here's an image of what I have: http://www.imagebullet.com/i/Sv3FrBmURS6V.gif
the central part of the GUI is a JPanel (the big part that contains "welcome to ...")
now I'd like to create a new JPanel with Netbeans to replace the current one when I click store new password from the tasks menu (see the image)
how can I do it? is this the correct approach at developing a GUI? or is there something I'm completely missing?
Edited by: Icecube on Mar 8, 2008 6:35 AM

Icecube wrote:
I'm trying to develop my first GUI and I'm using Netbeans to create the GUIThat may be your first mistake. The more you offload code creation to another program (the NetBeans GUI builder), the less you understand about the concepts. If you really want to learn about coding a GUI, learn to do it without code generation software by going through the Sun Swing tutorials.
now I'd like to create a new JPanel with Netbeans to replace the current one when I click store new password from the tasks menu (see the image)
how can I do it? is this the correct approach at developing a GUI? or is there something I'm completely missing?You could use a CardLayout as one way to solve this. Again, check out the tutorials for this (you can search the tutorial), and also check the API. Good luck.

Similar Messages

  • Java GUI Help Needed

    Can someone help me find a link, book, tutorial or anything along those lines that can help me understand building a GUI in Java? Thanks, Jeremy

    When I was about to create my first GUI I used an IDE with "visual" capabilities. You design the GUI by using drag-and-drop and filling in tables, and then the IDE generates the code automatically for you. I found this helpful because Swing is so complex and in this way you get your options presented to you and you can study the generated code.

  • Help needed: replacement of display panel (HP Pavilion G7-1150US)

    Hi all,
    My brand new (< 2months old) HP Pavilion G7 1150US laptop's screen is broken, I need help in buying the panel. Where can I purchase the display panel.
    I dont need the complete display assembly (unless the cost is not more than a few bucks of that of the panel alone), i just need the panel.
    PART number: 641395-001
    17.3” Diagonal HD+ High-Definition HP LED BrightView Widescreen Display (1600 x900) 
    Thanks in advance.
     Ram
    This question was solved.
    View Solution.

    eBay:
    auction
    Youtube
    I did not watch the video but it cannot hurt for you to do so. If you need more help post back. I actually think it is easier to replace just the panel as opposed to the entire assembly, but that is me.

  • GUI Help Needed

    *////The declaration*
    Entry [] entries  - array of entries
    Int eno      - number of Entrys in entries
    Int MAXE = 100; maximum number of entrys in entries
    Int current ? index in entries of entry *///////I have few Jtextfields in a GUI where when I click ?new? Jbutton it would put the Jtextfields in entries[eno] can I know how to write this code .*
    Public void actionPerformed (ActionEvent E) {
    If (e.getSource==new) ;
    Sorry not sure how to write plz help
    }

    What is an Entry? What is an Int?
    I have few Jtextfields in a GUI where when I click ?new? Jbutton it would put the Jtextfields in entries[eno] can I know how to write this code .If you want to put the JTextFields in entries[], then entries has to be of type JTextField[]. Or do you want to put the strings that were entered into the JTextFields into entries[]?
    Here is my attempt:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    class MyWindow extends JFrame implements ActionListener
      private ArrayList<JTextField> textBoxes;
      private ArrayList<String> entries;
      public MyWindow()
        //Initialize frame:
        super("Testing");
        setBounds(20, 100, 500, 500);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        textBoxes = new ArrayList<JTextField>();
        entries = new ArrayList<String>();
        //Create textboxes:
        textBoxes.add(new JTextField("", 20));
        textBoxes.add(new JTextField("", 30));
        //Create button:
        JButton newButton = new JButton("new");
        newButton.addActionListener(this);
        //'this'-->look in this class for actionPerformed() method
        //Create panel:
        JPanel panel = new JPanel();
        for(JTextField textBox: textBoxes)
          panel.add(textBox);
        panel.add(newButton);
        //Add panel to window:
        Container cpane = getContentPane();
        cpane.add(panel);
      public void actionPerformed(ActionEvent ev)
        for(JTextField textBox: textBoxes)
          entries.add(textBox.getText());
        for(String str: entries)
          System.out.println(str);
    public class WindowTest
      public static void createAndShowGui()
        MyWindow win = new MyWindow();
        win.setVisible(true);
      public static void main(String args[])
        //The proper way to launch a java gui:
        Runnable runner = new Runnable()
          public void run()
            createAndShowGui();
        SwingUtilities.invokeLater(runner);
    }Or maybe you don't know how many JTextFields there are in the window? Is the user adding them dynamically?
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    class MyWindow extends JFrame implements ActionListener
      private ArrayList<JTextField> entries;
      JPanel panel;
      public MyWindow()
        //Initialize frame:
        super("Testing");
        setBounds(20, 100, 500, 500);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        entries = new ArrayList<JTextField>();
        //Create textboxes:
        //Create button:
        JButton newButton = new JButton("new");
        newButton.addActionListener(this);
        //'this'-->look in this class for actionPerformed() method
        //Create panel:
        panel = new JPanel();
        panel.add(new JTextField("", 20));
        panel.add(new JTextField("", 20));
        panel.add(newButton);
        //Add panel to window:
        Container cpane = getContentPane();
        cpane.add(panel);
      public void actionPerformed(ActionEvent ev)
        int count = panel.getComponentCount();
        System.out.println(count);
        Component comp = null;
        for(int i=0; i<count; ++i)
          comp = panel.getComponent(i);
          if(comp.getClass() == JTextField.class)
            entries.add((JTextField)comp);
        for(JTextField tf: entries)
          System.out.println(tf.getText());
    public class WindowTest
      public static void createAndShowGui()
        MyWindow win = new MyWindow();
        win.setVisible(true);
      public static void main(String args[])
        Runnable runner = new Runnable()
          public void run()
            createAndShowGui();
        SwingUtilities.invokeLater(runner);
    }

  • JAX-WS contract first solution help needed

    Hi,
    I am trying to create a bunch of web services using jax-ws which I will deploy on Jboss. I would like to create xml schemas and wsdl files before I create my solution because I want a clearer contract betweent client and server that is not defined by the server code.
    I have managed to create an xml schema and generated the message files. I also created a wsdl file and implemented a service endpoint which refers to the wsdl file.
    My problem now is that I cannot seem to get the mapping (marshalling) to the Java objects to work correctly. When I create a simple client that calls the service defined in the wsdl file I have managed to get the request to map to the webmethod in my endpoint. But I cannot seem to figure out how to get my message validated against the schema, which means that I can call the method with any type of request without getting an error message. This is also true for the return object. The solution doesn't seem to care whether I return a string or the object defined in the wsdl file.
    I created my solution as a "regular" jar which I deploy on Jboss.
    @Stateless
    @WebService(name = "Test", portName = "TestPort", targetNamespace = "http://www.company.com/test-service/", wsdlLocation = "META-INF/wsdl/test-service.wsdl")
    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
    public class TestBean {
         @WebMethod(operationName = "PerformOperation")
         public Response newOperation(Request request) {
              return response;
    }Could you give me some tips and advice to help me finish my solution. It would also good if anyone could tell me how to turn message validation on.
    Regards,
    Leo

    Hi Nico,
    In multithreading, all the threads are independent. Here the threads miao and bau are independent.
    There is no guarantee which thread executes first. In your program for miao you explisitly called sleep and hence bau thread executed.
    Explanation:
    ========
    When you start both the threads miao and bau both are in runnable start. Only one thread can go to running. Lets consider miao goes to running state. Because you called sleep miao goes to sleeping and bau goes to running state and once the sleep completed for miao it goes to runnable state and as bau is in running and once bau completes miao again goes to running state and then it also completes.
    Thanks & Regards,
    Murali.
    ===========

  • XML Gurus -My first request -Help needed urgently

    Hi XML gurus,
    I have a requirement to convert the following XML into two oracle tables.This is the first time I am looking at an XML script this closely....Could any of the gurus study the pattern of the xml and convert this into oracle tables with the constraints and post the script.After some thorough look I am able to conclude that the data has to be pushed into two tables.Appreciate your help!!
    XML file is as below
    - <Batch BatchCreated="633479274856698434" TransType="EISendCATProfile">
    - <SiebelMessage>
    - <CATProfiles>
    - <CATProfile Id="1-6XCMTV3">
    <CATCode>SE0</CATCode>
    <LegacyHandled>N</LegacyHandled>
    <DOLStart>05/31/2008</DOLStart>
    <DOLEnd>06/02/2008</DOLEnd>
    <Status>New</Status>
    <TransStatus>Pending</TransStatus>
    <Description>CAT SE0 MN Auto Wind and Hail Prop Wind, Hail and Other Weather 5/31 - 6/2</Description>
    <GMTCreated>06/01/2008 14:23:26</GMTCreated>
    <GMTUpdated>06/01/2008 14:31:21</GMTUpdated>
    - <Details>
    - <Detail Id="1-6XCMTV5">
    <State>MN</State>
    <PolicyType>Auto</PolicyType>
    <ClaimType>Comprehensive</ClaimType>
    <CauseOfLoss>Hail</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:23:47</GMTCreated>
    <GMTUpdated>06/01/2008 14:24:11</GMTUpdated>
    </Detail>
    - <Detail Id="1-6XCMTV9">
    <State>MN</State>
    <PolicyType>Auto</PolicyType>
    <ClaimType>Comprehensive</ClaimType>
    <CauseOfLoss>Wind</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:24:11</GMTCreated>
    <GMTUpdated>06/01/2008 14:24:28</GMTUpdated>
    </Detail>
    - <Detail Id="1-6XCMTVC">
    <State>MN</State>
    <PolicyType>Commercial Auto</PolicyType>
    <ClaimType>Comprehensive</ClaimType>
    <CauseOfLoss>Hail</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:24:29</GMTCreated>
    <GMTUpdated>06/01/2008 14:24:45</GMTUpdated>
    </Detail>
    - <Detail Id="1-6XCMTVF">
    <State>MN</State>
    <PolicyType>Commercial Auto</PolicyType>
    <ClaimType>Comprehensive</ClaimType>
    <CauseOfLoss>Wind</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:24:47</GMTCreated>
    <GMTUpdated>06/01/2008 14:25:10</GMTUpdated>
    </Detail>
    - <Detail Id="1-6XCMTVI">
    <State>MN</State>
    <PolicyType>Commercial Property</PolicyType>
    <ClaimType>Commercial Property</ClaimType>
    <CauseOfLoss>Windstorm & Hail</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:25:13</GMTCreated>
    <GMTUpdated>06/01/2008 14:25:55</GMTUpdated>
    </Detail>
    - <Detail Id="1-6XCMTVL">
    <State>MN</State>
    <PolicyType>Homeowners</PolicyType>
    <ClaimType>Property</ClaimType>
    <CauseOfLoss>Hail</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:25:57</GMTCreated>
    <GMTUpdated>06/01/2008 14:26:14</GMTUpdated>
    </Detail>
    - <Detail Id="1-6XCMTVO">
    <State>MN</State>
    <PolicyType>Homeowners</PolicyType>
    <ClaimType>Property</ClaimType>
    <CauseOfLoss>Wind</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:26:16</GMTCreated>
    <GMTUpdated>06/01/2008 14:27:06</GMTUpdated>
    </Detail>
    - <Detail Id="1-6XCMTVU">
    <State>MN</State>
    <PolicyType>Homeowners</PolicyType>
    <ClaimType>Property</ClaimType>
    <CauseOfLoss>Other Weather Related</CauseOfLoss>
    <Status>New</Status>
    <GMTCreated>06/01/2008 14:29:35</GMTCreated>
    <GMTUpdated>06/01/2008 14:29:52</GMTUpdated>
    </Detail>
    </Details>
    </CATProfile>
    </CATProfiles>
    </SiebelMessage>
    </Batch>
    Thanks Much!
    Sridhar

    I tried what you told AnanSmriti.
    But still Server cannot find the page .
    I have saved JSP pages in DefaultWebApp and Java class files in WEB-INF /classes under DefaultWebApp dir.
    Also I have given the same URl in web.xml as in my first page.
    Please tell me where am I going wrong.
    Thanx in advance for any help.

  • Help Needed - replacing space with non-breaking space on the fly

    Hi,
    I have a text field I'm trying to fiddle the input on. Basically I want to replace all spaces (ascii code 32) with non-breaking spaces (ascii code 160) as they are typed.
    It seemed as though a KeyListener was the way to go, and I've successfully detected whenever a space is sent. I can consume() that KeyEvent, or setKeyChar to change it to another key. But I cannot see how to change it to a non-keyboard character.
    Any suggestions?

    i think you can do smt likeDocument doc = mySwingTextComponent.getDocument();
    doc.setDocumentFilter(new MyDocumentFilter());
    class MyDocumentFilter extends DocumentFilter {
       public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException {
          fb.remove(offset,length);
       public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
          replace(fb,offset,0,string,attr);
       public void replace(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException {
          text.replaceAll("SPACE","NB WHITE SPACE");
    }asjf
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/DocumentFilter.html

  • Using swing i have problem of garblled gui. help needed...

    i have created a desktop software.
    when i use it on windows 98 i have problem. mouse disturbes the gui apparance. it just creates squares on gui as it moves.
    why??
    on windows 2000 or XP it 's ok

    Go to www.icloud.com.  Remove the device from your Find My iPhone there.
    Find My iPhone Activation Lock: Removing a device from a ...

  • Chat Program - GUI Help needed.

    Ello, I'm making a chat client, and I've got a slight problem :
    In the chatwindow, you usually have a field where the text is typed, and when <enter> is pressed, this text is sent to the server and to the textpane.
    I'm looking to make something similar to MSN : for that particular field I want a multiline widget (I can put it inside a JScrollPane), that throws an ActionEvent when <enter> is pressed.
    Does anybody know of a component for me?
    thx,
    SJG

    You could use a JTextArea for the MultiLine stuff and add:
    myTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyReleased(KeyEvent e) {
    if (e.getKeyCode() == 10) // I think enter is 10
    // do somethinf
    I think the key code is 10 for enter but not 100% sure.
    I hope this helps.

  • Re: Course management system gui help needed

    "How should I go about doing this?"
    how about a google for servlets
    and what should I use?"
    your brain
    a little bit of effort
    servlets chapter 11
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    jdbc for database access
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    tomcat to host servlets
    http://jakarta.apache.org/tomcat/

    i bought it second hand, i've got a snow leopard disc that came with it. it tells me it can't restart to the 'untitled' drive thats part of the hard drive when i go through he start up/reboot process.

  • Need Help in Replacement of Function Modules

    Hello all,
    I am working on Upgrade project from ECC 5.0 to ECC 6.0. I am facing problems for Replacement of two Obsolete Function Modules. Please give me a solution. FM's  are as follows.
    1) SET_AUTHORITY : This FM is obsolete in ECC 6.0 and there is not alternative FM present in help.sap.com or any other web portal.
    2) WS_QUERY : Here as per my knowledge we use class CL_GUI_FRONTEND_SERVICES and methods FILE_EXIST or DIRECTORY_EXIST as per the parameters in old FM. For parameter 'FS' we use 'FILE_EXIST' and 'DS' we use 'DIRECTORY EXIST'.
    But in our program prev. FM has parameter 'OS' i.e. Operating System.
    But there is not method called 'OS EXIST' or similar. Please suggest suitable method.
    Thanking you all in anticipation.
    Best Regards,
    Harish

    Hi Harish,
                       I too could not find any replacement for SET_AUTHORITY
    Obsolete Modules can be used in newer versions, but it is not supported by SAP in case of any technical issues.If you still need a replacement, you can replace it by the source code in the FM SET_AUTHORITY itself and modify according to your needs.
    Below is the source code of FM SET_AUTHORITY, so you can modify it according to your requirement.
      DATA: l_actvt  TYPE tact-actvt,
            l_hier   TYPE STANDARD TABLE OF sethier WITH HEADER LINE.
      CASE action.
        WHEN 'A    '.
          l_actvt = activity-add.
        WHEN 'C    '.
          l_actvt = activity-modify.
        WHEN 'D    '.
          l_actvt = activity-display.
        WHEN 'E    '.
          l_actvt = activity-delete.
        WHEN 'UD   '.
          l_actvt = activity-display.
      ENDCASE.
      CALL FUNCTION 'G_SET_TREE_IMPORT'
           EXPORTING
                no_descriptions  = 'X'
                no_rw_info       = 'X'
                setid            = set
                tabname          = table
                root_header_only = 'X'
           TABLES
                set_hierarchy    = l_hier
           EXCEPTIONS
                OTHERS           = 0.
      READ TABLE l_hier INDEX 1.
      IF sy-subrc <> 0.
        CLEAR l_hier.
        l_hier-shortname = set.
      ENDIF.
      CALL FUNCTION 'G_SET_AUTHORITY_CHECK'
           EXPORTING
                actvt  = l_actvt
                authgr = l_hier-authgr
           EXCEPTIONS
                OTHERS = 1.
      IF sy-subrc <> 0.
        CASE action.
          WHEN 'A    '.
            MESSAGE e827 WITH l_hier-shortname RAISING no_authority.
          WHEN 'C    '.
            MESSAGE e828 WITH l_hier-shortname RAISING no_authority.
          WHEN 'D    '.
            MESSAGE e829 WITH l_hier-shortname RAISING no_authority.
          WHEN 'E    '.
            MESSAGE e830 WITH l_hier-shortname RAISING no_authority.
          WHEN 'UD   '.
            MESSAGE e831 WITH l_hier-shortname RAISING no_authority.
        ENDCASE.
      ENDIF.
    If you need help in replacing in the above source code, please post your code here so that I can help you in modifying accordingly.
    Regards,
    Vasuki

  • HELP!!!! problem with motherboard HP Probook 4520s , need replacement, where can i buy it??

    HELP!!!! problem with motherboard HP Probook 4520s , need replacement, where can i buy it??

    bumer_v
    You can buy by HP PartSurfer or her
    Say thanks by clicking the "Kudos! Star" which is on the left.
    Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.

  • Need to partition current internal drive first...help needed

    Hello, I'm currently installing a version of leopard on my macbook pro intel 2 core duo. Problem is I had previously swapped out the hard drive for a 320 and failed to partition it as a GUID so the leopard installation is saying that needs to be done first. Fine, I'm backing up all my files and will be doing that. My question is if I go into disk utility and re-format the drive, it won't have an operating system on it so how do I boot from the disk. I mean at what point do I put the disk in and hold down 'C'. Will it turn on without an operating system installed. Or do I put the disk in first, then re-format the drive and restart or something? Otherwise I think I may be able to put in the leopard disk and have it re-format the drive for me, but I don't remember that being an option.

    You cannot partition the startup drive unless you boot from another device such as the OS X Installer Disc that came with your computer or a retail Leopard DVD that installs a version later than the one that came with the computer (if it came with Leopard pre-installed.) Here's what you do:
    Extended Hard Drive Preparation
    1. Boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger or Leopard.)
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area. If it does not say "Verified" then the drive is failing or has failed and will need replacing. SMART info will not be reported on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Set the number of partitions from the dropdown menu (use 1 partition unless you wish to make more.) Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID (only required for Intel Macs) then click on the OK button. Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    After formatting has completed quit DU and return to the installer. Complete the OS X installation.
    Booting From An OS X Installer Disc
    1. Insert OS X Installer Disc into the optical drive.
    2. Restart the computer.
    3. Immediately after the chime press and hold down the "C" key.
    4. Release the key when the spinning gear below the dark gray Apple logo appears.
    5. Wait for installer to finish loading.

  • I brought my iphone of my friend and i erased the iphone but now it wont let me have a sim in it without it telling me that the sim needs replacing. i got told the phone was unlocked.... any help?

    i brought my iphone of my friend and i erased the iphone but now it wont let me have a sim in it without it telling me that the sim needs replacing. i got told the phone was unlocked.... any help?

    ASk your friend who unlock the phone for him/her.
    ONly the carrier that the phone is locked to is authorized to unlock it.
    bAse on your description, it sounds like your friend had his/her phone hacked to unlock it from the original carrier.

  • This is my first Mac, I need on best site for Help me.

    This is my first Mac, I need on best site for Help me. Video is Better.

    http://www.apple.com/support/mac101/
    http://www.apple.com/support/switch101/ (for PC-Windows switcher)
    http://www.apple.com/findouthow/mac/ (videos)
    Stefan

Maybe you are looking for

  • Activating Object in IR - Getting Null Pointer Exception

    Hello, I'm having trouble activating object in my Intergration Repository.  When I activate any object I get a null pointer exception.  Below is the exception: #6 09:30:51 [AWT-EventQueue-0] ERROR com.sap.aii.utilxi.swing.toolkit.ExceptionDialog: Thr

  • Make files stored in Oracle db visible to Windows applications

    Hi. We have an application for storing images in an Oracle 10g interMedia. Now we want to make it possible for our users to access these images through normal Windows image processing tools (many different tools). Preferably it would work as if the u

  • 2nd replacement iPhone 4S and battery is even worse!!!

    So this is the second replacement iPhone 4S I received from an apple genius. The battery life is even worse on this one. Down 1% every 2-5 minutes?! Fully charged at 109% and during usage, it went down to 90% in 45 minutes. All of the settings that h

  • IDVD no audio solved, but ...

    like many other, I had the problem that when I edited my movies in iMovie and iDVD the audio was fine, until I started burning them on DVD or disk image. Than there was either no audio at all, or after some minutes (usually 5-15) the audio was gone.

  • Nokia 6280 Voice Dialing Problem...Help

    Can anyone tell me how to make a voice call? I try to press the right button and show me Voice System Error.