So you want an idea for a game? There are lot of games that are made with a "grid" of images: Tic-tac-toe, Chess, Reversi, Peg solitaire, Sudoku, Scrabble. Just to name a few.
In these games the...
Type: Posts; User: andbin
So you want an idea for a game? There are lot of games that are made with a "grid" of images: Tic-tac-toe, Chess, Reversi, Peg solitaire, Sudoku, Scrabble. Just to name a few.
In these games the...
stresstedout, listen please. This thread has arrived at post #123 (with my current answer) and we have spoken about a lot of things. Still now I don't know if you have well understood the concepts...
Honestly I also did not understand this english phrase ..... :((
For the very last time ....
import java.awt.*;
import java.net.*;
import javax.swing.*;
public class ButtonAndImageGrid {
private static String[] isbnCodes = { "0636920026518",...
First, I am very disappointed by the fact that I continue to give my help and you don't understand.
I have told you to create, for each cell in GridLayout, a new JPanel that contains JButton and...
So you want the button above and image (label) below?
JPanel cellPanel = new JPanel(new BorderLayout());
cellPanel.add(yourButton, BorderLayout.NORTH);
cellPanel.add(yourLabel,...
In my answer #42 I told you one thing and I can repeat here.
If you want that every cell (of GridLayout) contains a JLabel and a JButton, you have to create, for each cell, a new JPanel with a...
Ok, try the following example (note: it's a bit compact/contrived, just to be short. Don't do this in "real" apps!).
import java.awt.*;
import javax.swing.*;
public class GridLayoutTest {
...
GridLayout does a simple thing: it takes the size of the container (in which GridLayout is assigned) and divides it in NxM equally sized cells. So the main question is: who controls the size of the...
What do you mean? Can you be more precise?
There are many ways to develop and present a "memory" game (just only considering Swing as GUI), so there isn't a unique answer/possibility.
Technically it's perfectly possible.
Using mouse...
This depends on what you want .....
Layouting with AWT/Swing is not difficult ..... if you have the "basics".
Each "cell" in GridLayout can contain only 1 component. Instead to put a JLabel...
Not exactly .... and don't use available() if you don't know exactly what it does!
Yesterday I told you some things and more than one time. I don't understand why you don't understand .....
...
while (result.next()) {
image = result.getBytes("content");
}
// Here you have exausted the record-set. And you have not created any image (just got the raw image stream).
// Here you create 1...
If you have 1 image in each record, then create the image for each record. That is, into the loop. Not outside.
Here you are not creating 1 image for each record .... you have "exausted" the record set and then after, at the end, you create 1 image.
So what can you expect from a similar code?