I am trying to re-size my progress bars to better suit how i wish my interface to look, however no matter what I change the height and width to, no change happens at all.
Below is the code for one of my progress bars, there are 10 in total... I have set the width/height to 5px to 300px and so on, just to see if any change is happening.
barPanel.setLayout(new GridLayout(0 , 4));
healthBar = new JProgressBar (0,100);
healthLabel = new JLabel ("Health: ");
healthBar.setPreferredSize( new Dimension (width, height));
healthBar.setMaximumSize(new Dimension(width,height));
healthBar.setMinimumSize(new Dimension(width, height));
barPanel.add(healthLabel);
healthLabel.setForeground(Color.white);
barPanel.add(healthBar);
I have tried switching between grid and border layout, but I am pretty new to interface designing... very new, if anybody can help it would be greatly appreciated and if any more code fragments are required, I'll be glad to add them.
I would fully upload my solution, but its for a university assignment, at a later date I will fully update it.
It is just an adapted version of the solution before, but I created 4 panels and placed them within one parent panel.
Two panels for the JLabels and 2 panels for the progress bars. Then within these panels I added my JLabels and progress bars and sized and position them using the bounds method ie. barPanel.setBounds(10,10,300,25); (X, Y, width, height)
Sorry I cant give the full solution at the moment.