Hi, I'm making a gui with swing for a physics project. I'm really in trouble with this, I was supposed to hand it in last week (I have an extension for monday), because the coding part is taking so long since my strategy to do this is probably very bad. Please, any input / help is very appreciated. It looks like this so far:
-link removed- (I tried using the "insert image" feature but it was too small to see)
So there three buttons on the bottom called Big, Between, and Small. When the user clicks the "Big" button, the side panels look how they are in the picture. Depending what the user clicks on the side panels, the center panel changes to a screen where theres information on that subject, videos, etc.
I thought I could tackle this my own way (having limited knowledge of swing, no openGL, etc). But it is getting really complicated. What I'm doing is, each section of the interface (left, center, right, top) are their own JLabels, with an ImageIcon as setIcon(). Lets say for the center panel, where there are three buttons (big, between, and small) I have four different pictures, in which one picture is with no buttons selected, and then one picture for each button being selected.
Then on top of the JLabel, I have a mouse listener to determine when the user clicks, and where. I have two "types" of switch statementss. I use one 'type' of switch statements for all the positions of the buttons to determine where the use clicks, and then depending on where they click the corresponding code. The other 'type' of switch statement determines what state the program is in(for example, if state = 2, then use the switch statement for for the buttons that belong to "big" (universe, galaxy, stars, future tech, etc).
Using this method, I currently have over 120 pictures and over 30 switch statements, with around 10+ cases for each of them.
How would you do this? My method is not going to work. Basically I'm doing this to make an "attractive" gui (I realize my gui is ugly lol).
Note I have my buttons as part of the background image (which is why I have to have a picture for every possible combination) because they have transparency on the edges. I don't believe if I create imageIcons for the buttons I will keep the transparency of them.
I understand the right way to do this would be to use open GL, but I don't know it and I don't really have the time to do so.
Any input at all is greatly appreciated, Thanks!
edit: if you want too see what I mean by having an image for each possible combination, an early test of my program is here:
note in this version I had an arrow over the button in which the mouse was hovering over, so even though theres only three buttons, I had 14 pictures for all the different combinations. (E.g. click the "The Very Big" Button and then hover your mouse of the "everything inbetween" and "the very small" buttons. You can see the Very Big button's image changes a bit.)