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
  • GUI that OSbuddy has?


    Cardozz

    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.

    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

    As far as I'm aware they hardcoded their icons and UI, using custom painters for each swing component they use :)

    In addition to this they are using a custom Substance Look and Feel skin
    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • 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.