Results 1 to 9 of 9
Like Tree2Likes
  • 1 Post By Fubarable
  • 1 Post By Fubarable

Thread: A application that exist with or without JFrames

  1. #1
    Otyugh is offline Member
    Join Date
    Dec 2012
    Posts
    7
    Rep Power
    0

    Default A application that exist with or without JFrames

    Hey,
    I'm doing some little piece of software.
    Thought, i want to do something i very appreciate in few application.

    "The application does not close when his principale Frame is closed"
    and
    "If the application is focused again, show the principal Frame"

    I first tryed to make it happens by using first "setVisible(false);" when i push on "close the window", and then with a "FocusListener" say "if focused, then, setVisible(true)".
    My issue is that i can't focus something inivisible, it seems.

    I don't know if it's understandable or not, ask for any other formulation, i'm up to it :o

  2. #2
    Otyugh is offline Member
    Join Date
    Dec 2012
    Posts
    7
    Rep Power
    0

    Default Re: A application that exist with or without JFrames

    Example of application doing that : MSN, Pidgin... (and maybe Skype, thought)

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: A application that exist with or without JFrames

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: A application that exist with or without JFrames

    Quote Originally Posted by Otyugh View Post
    My issue is that i can't focus something inivisible, it seems.
    I don't see how you could even think this could be possible. Where would you possibly click the mouse or tab to in order to transfer the focus to a UI element that's not displayed?

    You might want to take a look at the java.awt.TrayIcon API.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    Otyugh is offline Member
    Join Date
    Dec 2012
    Posts
    7
    Rep Power
    0

    Default Re: A application that exist with or without JFrames

    Let my show you a situation.
    Class App(){
    public static void main(String[] args) {
    JFrame jf = new JFrame();
    jf.setVisible(false);
    }

    Now, i have a "App" launched (without any windows) and the user can see AND select it.

    When the user "select the application" I want it to set jf.setVisible(true);.

    I don't know how to do that ! I mean, when you select the "application" a focus go to one of the "Windows of the application". This MUST be a listener somewhere. I don't know which.
    Last edited by Otyugh; 12-26-2012 at 05:56 PM.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: A application that exist with or without JFrames

    Quote Originally Posted by Otyugh View Post
    Let my show you a situation.
    Class App(){
    public static void main(String[] args) {
    JFrame jf = new JFrame();
    jf.setVisible(false);
    }

    Now, i have a "App" launched (without any windows) and the user can see AND select it.
    How can the user see or select anything if there is no visible window? I do not understand what you are trying to do.
    null likes this.

  7. #7
    Otyugh is offline Member
    Join Date
    Dec 2012
    Posts
    7
    Rep Power
    0

    Default Re: A application that exist with or without JFrames

    You know theses "icones" that appear in the bottom of your "main os interface" ?

    A very usual example would be theses calendars that you "display" only time to time, but which are always "launched but without window" in fact.

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: A application that exist with or without JFrames

    So you want to launch the GUI, *not* make it invisible but rather you wish to iconify it. That's a big difference. You will want to call the JFrame's setState(...) method and pass in the constant JFrame.ICONIFIED.
    DarrylBurke likes this.

  9. #9
    null is offline Member
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Default Re: A application that exist with or without JFrames

    Quote Originally Posted by Otyugh View Post
    Let my show you a situation.
    Class App(){
    public static void main(String[] args) {
    JFrame jf = new JFrame();
    jf.setVisible(false);
    }

    Now, i have a "App" launched (without any windows) and the user can see AND select it.
    ...
    How will the user be able to select the frame when the frame is not yet displayable? [jf.setVisible(false);] Where will the user "select" the App? I guess maybe you are trying to create an App with "undecorated frame"

Similar Threads

  1. Replies: 0
    Last Post: 09-27-2012, 03:01 AM
  2. package does not exist
    By loja11 in forum New To Java
    Replies: 2
    Last Post: 09-25-2011, 04:26 PM
  3. Exist or not exist file problem
    By Ballister in forum New To Java
    Replies: 6
    Last Post: 12-26-2010, 07:29 PM
  4. HttpClientLibrary does not exist
    By gbose in forum Networking
    Replies: 1
    Last Post: 02-03-2010, 07:21 PM
  5. package mj does not exist
    By PzK in forum New To Java
    Replies: 8
    Last Post: 12-03-2008, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •