I'm not sure I understand what you are asking. Is it a question about the code or what?
Type: Posts; User: Norm
I'm not sure I understand what you are asking. Is it a question about the code or what?
4)panel with the image and the button added to the panel with the gridlayout
That says to create a panel, add the two things to it and add that panel to the gridpanel. See post#70
That's it...
4)panel with the image and the button added to the panel with the gridlayout
No. That code does the opposite: adds gridpanel to the cellpanel (which should contain the image and button) Look at...
Now what about step 4?
That has nothing to do with creating the GUI.
The order of the steps is important.
Try the steps in the order I recommended and see what happens then.
It looks like steps 5 and 6 (from post#106) are not done last. They are done before steps 2, 3 & 4
For learning how to create a GUI make a test program as done in post #51. When that works,...
From post#92, re-ordered:
1)image created
2) new image added to a panel
3) button added to panel
4)panel with the image and the button added to the panel with the gridlayout
5)filled panel...
You do NOT need a for statement that only loops one time.
look at post#70 for how to put the image above the button. There isn't any Database used in the code from post#51. Using a DB just makes it harder for this testing. Use a single image that is read...
A suggestion to learn how to make a GUI with image over button:
Take the code from andbin's post#51 and modify it to build panels with images over buttons using the technique shown in post#70.
The...
What is a loop that loops once?
See post#70.
Put them in a panel and add that panel to the panel with the gridlayout. See steps 4 & 5 in post#92
No, that does not look like a list of steps in pseudo code.
The code is missing several steps.
What does the for loop that loops 2 times do? Why is it there?
Are there supposed to be buttons...
Take the questions one at a time and decide when they should be executed. Make a list of pseudo code statements to show when each should be executed.
This project may be too advanced for your...
The methods should be called when they are needed to do something.
1)When does the GUI need to be packed and shown?
2)When does a filled panel need to be added to the frame?
3)When should the...
One problem I see inside the while loop is there are method calls being made that should only be made one time, not every time an image is created:
setVisible() - only needs to be done ONE time...
Its a little better, but there are still too many statements starting in the first column.
And there are too many statements that are indented that should NOT be indented:
ImageIcon icon = new...
No.Too many nested statements start in the first column making it hard to read and understand the logic in the code.
The }s should not be one above the other (in the same column)
See post#51 for...
Can you edit the code and format it properly?
Nested statements should be indented
}s should NOT be hidden at the end of statements. Put them on their own line.
No, the compiler will...
Can you fix the formatting of the code? The indentations are not right. There are missing }s
The posted code is a mess. There are a lot of definitions missing.
You don't need the database to work on the GUI problem you are having. For testing you can use a single image read from the disk.
Later when the GUI is working, you can put in the code to read...
Please edit the post and properly format the code. Nested statements need to be indented. Too many statements are starting in the first column. See post#51 for an example.
For testing the creation...
How have you tried using the code provided by andbin? You need to try and when you have problems, post the code and the error messages.
Can you make a small, complete program that compiles, executes and shows the problem?
Did you read my last post? What is wrong with the description I posted there?
In the image in post#65 I see 5 rows with 4 columns of rectangles all containing images. Where are the buttons in...
Sorry, I don't go to other sites.
If it is not one of the two choices I asked about, I don't understand what you are asking.
What is wrong with this explanation?
would it be like this:
XXX...