Cardozz 46 Posted July 2, 2016 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. Also the Dreambot client has the same layout.
Eclipseop 194 Posted July 2, 2016 https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
Articron 746 Posted July 2, 2016 As far as I'm aware they hardcoded their icons and UI, using custom painters for each swing component they use
Cardozz 46 Author Posted July 2, 2016 https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html As far as I'm aware they hardcoded their icons and UI, using custom painters for each swing component they use Ahh okay thanks guys. Still looking for a small guide though, if anyone knows how to get the actual frame
Notorious 342 Posted July 2, 2016 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.
Cardozz 46 Author Posted July 2, 2016 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
Dogerina 330 Posted July 4, 2016 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
Cardozz 46 Author Posted July 4, 2016 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?
Pandemic 2842 Posted July 4, 2016 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.
Cardozz 46 Author Posted July 4, 2016 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:)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.