Well my title seems vague. But, I realized that I have an MoparScape account for +4 years, and decided to be active on the community. Finally decided to learn Java, during my life crisis in trying to do something with my life.
Issue #1: Panel arrangement
I created a program, and there are minor issues with how the FlowLayout() is trying to do it’s job but is not working out too well. Not sure if is something to do with how I setup my panels, or I am just being stupid.
Here is the image, as you can see the JLabel() Setting and Frequency is like together… Not sure if I should add each of them on a different panels. All the Panels are being handled within different methods.
Issue #2: Creating a dynamic JLabel()?
Well, As you can see I have a custom range which user can enter through JTextField(). However my algorithm only does up to 1-10. How would I achieve, in a way that it does not take too much space? I was thinking to set a limit where user can only input from 1-100. So when the program runs, it will only “show” that specific range?
And here is the current algorithm, which uses for enhanced loops which can be found at my source code, GraphicalInterface.java
[code=java] private void frequencyMethod() {
//Issue #1: labelFrequency is being floated to the left with labelSetting
mainPanel.add(labelFrequency);
int counter = 0;
for (JLabel label : frequencyLabel) {
frequencyLabel[counter] = new JLabel(Integer.toString(counter+1));
frequencyStatsLabel[counter] = new JLabel("0%");
panelFrequency.add(frequencyLabel[counter]);
panelFrequency.add(frequencyStatsLabel[counter]);
counter += 1;
}
}[/code]
Anyways here is the source code: