Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By JosAH

Thread: AlwaysOnTop Question

  1. #1
    Gunderak is offline Member
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Question AlwaysOnTop Question

    Sorry if this is a silly question but I am new to Java.
    Anyway, I am trying to make an application which has a checkbox and when you click it, the application toggles the alwaysontop boolean.
    I can't figure out how to actually change the setting via code.
    To create the form I am using this: new MainForm().setVisible(true);
    I also named the form TestWindow I have tried things like TestWindow.dostuff but with no luck.
    Any idea's?
    Thanks.
    Last edited by Gunderak; 05-26-2012 at 09:46 AM. Reason: Grammatical error correction.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: AlwaysOnTop Question

    Do you get compilation errors? Runtime errors?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Gunderak is offline Member
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Default Re: AlwaysOnTop Question

    No there isn't any errors, but I can't figure out how to make the form always top.
    Also is there any way to make the library files go inside the jar when you build it instead of having a lib folder?
    Well better worded, is there any way to make it standalone including library files?
    I have managed to make it standalone by manually copying the library class files into it through winzip but this would get annoying having to do it every time.
    Cheers.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: AlwaysOnTop Question

    Have you tried a JDialog instead of a JFrame? A JDialog has a parent frame (or another frame) and it always stays on top of its parent. If those library files are native libraries you should think of an installer that installs not only your .jar(s) but also the library files; that's how it's normally done; there's no free lunch here. IzPack (Google is your friend here) is a nice, free installer.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Gunderak is offline Member
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Default Re: AlwaysOnTop Question

    I think I'll just stick with what I have for now then..
    Also in Netbeans for some reason certain things I can't backspace or delete.
    Like some area's it has private void blah blah it's like it's locked or something.
    Really frustrating.

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: AlwaysOnTop Question

    Quote Originally Posted by Gunderak View Post
    I think I'll just stick with what I have for now then..
    Also in Netbeans for some reason certain things I can't backspace or delete.
    Like some area's it has private void blah blah it's like it's locked or something.
    Really frustrating.
    Most likely those uneditable parts are parts of code generated by Netbeans. That's a reason I don't like Netbeans: I do the code writing and my editor or IDE should keep its mouth shut. I believe you can 'unlock' those code parts but I don't know how; read the manual.

    kind regards,

    Jos
    Fubarable likes this.
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. loop wuestion
    By mehnihma in forum New To Java
    Replies: 6
    Last Post: 11-03-2011, 12:54 AM
  2. Replies: 2
    Last Post: 10-14-2009, 05:47 AM

Posting Permissions

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