Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • GUI that OSbuddy has?


    Cardozz
     Share

    Recommended Posts

    Hi again!

     

    I as wondering how i could create the GUI layout (just the frame layout) that OSbuddy has. I'm talking about the frame with the buttons and stuff at the top right corner.

     

    It looks like it's an undecorated window, but i feel like theres a simple way to get this frame.

     

    64a3252cfaf5985f26284ca99b7407a1.png

     

    Also the Dreambot client has the same layout.

    Edited by Cardozz
    Link to comment
    Share on other sites

    Undecorate the JFrame, add a content panel.

     

    Then you have a couple options.

     

    1. (Probably the best way) Create a JPanel to act as your WindowBar; for this I would use a BoxLayout(X_AXIS), a JLabel for the window icon, a JLabel for the title, a JSeperator to add a space, then three JButtons for each of the window control options. Then add listeners to each of the needed components to make it work.

     

    2. (Convoluted) Override the content panel paintComponent(Graphics), and draw the window bar, and a add mouse listener to content panel and determine which component to handle by the position of the mouse.

    Link to comment
    Share on other sites

    Undecorate the JFrame, add a content panel.

     

    Then you have a couple options.

     

    1. (Probably the best way) Create a JPanel to act as your WindowBar; for this I would use a BoxLayout(X_AXIS), a JLabel for the window icon, a JLabel for the title, a JSeperator to add a space, then three JButtons for each of the window control options. Then add listeners to each of the needed components to make it work.

     

    2. (Convoluted) Override the content panel paintComponent(Graphics), and draw the window bar, and a add mouse listener to content panel and determine which component to handle by the position of the mouse.

    Thanks for this noto! Lovely

    Link to comment
    Share on other sites

    Undecorate the JFrame, add a content panel.

     

    Then you have a couple options.

     

    1. (Probably the best way) Create a JPanel to act as your WindowBar; for this I would use a BoxLayout(X_AXIS), a JLabel for the window icon, a JLabel for the title, a JSeperator to add a space, then three JButtons for each of the window control options. Then add listeners to each of the needed components to make it work.

     

    2. (Convoluted) Override the content panel paintComponent(Graphics), and draw the window bar, and a add mouse listener to content panel and determine which component to handle by the position of the mouse.

    Though, i found out and heard that any pictures for icons packed with the jar will not be taken over in the SDN. So let's say if i put an X icon for the close button, the GUI won't start up if it's ran through the SDN since it can't find the icon image. Anything i can do about that?

    Link to comment
    Share on other sites

    Though, i found out and heard that any pictures for icons packed with the jar will not be taken over in the SDN. So let's say if i put an X icon for the close button, the GUI won't start up if it's ran through the SDN since it can't find the icon image. Anything i can do about that?

    Host the image on imgur or something. :)

    Link to comment
    Share on other sites

    Host the image on imgur or something. :)

    Aight so you can get the image by URL, but not pack the image inside of the jar? Sounds good also imo:)

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.