I'm presently doing a chess project for school where users can log on to my site, i came up with a way of making each square a Panel(using FlowLayout()) and then add a JLabel with the chess piece as it's icon...the problem is browsers do not support swing...What do I do??? (anyone, everyone please help!!!)
Alex Kravets
Ranch Hand
Joined: Jan 24, 2001
Posts: 476
posted
0
Do you have JRE installed? Plus, why don't you use GridLayout? A chess boards looks like a table already (8X8), so with GridLayout it's going to be easier to manipulate. - Alex
All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson
Jerome McKenzie
Greenhorn
Joined: Nov 05, 2001
Posts: 2
posted
0
ok...i should have explained myself better... i have a large Panel which has a gridlayout all 64 panels are layed out in 8X8 formation each panel uses flowlayout (so the label automatically finds the center of the panel it occupies) problems: ---------- 1 - One of the requirements of the projects is that I must show the user the illusion of a "drag n' drop" (how am i going to do that one?) 2 - I need a kind of plug-in for the browser so the applet and have Swing components
To create the illusion of drag and drop, this is a rough summary of what I did. I created a mouseListener on my panel. Then when I pressed on the mousebutton, as long as It was pressed, I would remove(label), add(label), panel.repaint() with the bounds of the label being set to my mouse pointer. So I would also get the pointer position of x and y on the grid. It worked pretty well actually. ------------------ Happy Coding, Gregg Bolinger