GUI Questions from a newbie

x_at_a.c
Date: 03/01/04

  • Next message: Thomas Weidenfeller: "Re: draw directed graph with nested panels"
    Date: Mon, 1 Mar 2004 23:47:06 +1100
    
    

    Hi,

    I am very new to Java and OOP although I have done procedural programing for
    a few years now so sorry if this post is a real 'Duh!'

    What I am wanting to do is have an application (not an applet) that will
    allow me to call a PHP script on a remote server, return as xml a list of
    media (audio, text, video) and show the list.

    My question regards the interface I am trying to develop.
    What I want is, when the app first load, have a main window that takes a
    username and password and has a button to 'logs on'.
    If the logon is successful the I would like the logon fields to be removed
    (perhaps replaced with a single logout button) and the main frame to display
    a list of media.

    What I have been trying was to make a main window and dynamically update is
    contents depending on what has been done.
    I can build the main window and add the login pane but am unable to remove
    the pane again and replace it with the list pane. Is what I am trying to do
    feasible/possible/practical? All the demos and turorials I have looked at so
    far seem to all run in the first view that is loaded.
    Is there a better method to achieve what I want?

    I have tried quite a few things (pane.remove(componet), removeAll()) but
    nothing seems to happen (except that the button sticks) .
    As I mentioned I am a long time scripter so it is still a very new minsdset
    for me to be working with.
    Any hints, tips, links, resources or words of encouragement will be greatly
    appreciated.

    Cheers

    Xav

    the code looks a little like this

    ---
    //imports javax. swing, java.net, javaio, java.awt
    public class MakeMain extends JFrame implements ActionListener{
    Container mainPane;
    LogPane logPane;
    ListPane listPane;
        MakeMain(){
        super("Media List");
        setSize(400, 600);
        setVisible(true)
        mainPane = getContentPane();
        logPane=new LogPane();
        logPane.logbutton.addActionListener(this);
         mainPane.add(logPane);
        setVisible(true);
    }
        public void actionPerformed(ActionEvent evt)
        {
         // if evt source is the login button
        //then test login. If login is true then clear window
        //of login details and
        }
        boolean doLogin(String rURL, name, pass){
        //call url with parameters
        //xml is returned
        //if valid list then return true
        //else return false
        }
        public static void main(String[] args){
        MainPane myMain = new MainPane();
        }
    }
    class LogPane extends JPanel{
    // define JLabels, JTextFields, JButton
        LogPane()
        {
        //create and add 3 rows
        //1 for username, 1 for pass, 1 for button
        }
    }
    class ListPane extends JPanel{
    //builds a list from the xml returned from the remote page
    }
    --
    

  • Next message: Thomas Weidenfeller: "Re: draw directed graph with nested panels"

    Relevant Pages

    • Re: Kerberos
      ... client machines, with the same result each time. ... The logs for the non-prompted login show: ... first) and not(with a window opening). ... Microsoft Online Community Support ...
      (microsoft.public.inetserver.iis.security)
    • Re: Shutdown, No Login/Logout Window
      ... I have problems Log Out> End Session, takes me straight to the 'shell' ... login window and goes right back to Desktop of last user. ... If I reboot computer I get the "Login Window" ...
      (Fedora)
    • Re: A Bug in Remote Desktop Connection of Windows Server 2003 R2
      ... There are two servers. ... I login to the servers with "remote ... the current window loses focus; ... the system turns to another window; ...
      (microsoft.public.windows.vista.general)
    • Upgrade from RHEL3 to RHEL5 - desktop
      ... Ctl-Alt-Bksp gets me back to the login window, ... If I am logged in as root, I can make new desktop icons by dragging from ... The existing three icons work, ...
      (linux.redhat.misc)