Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Swing components and browsers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing components and browsers" Watch "Swing components and browsers" New topic
Author

Swing components and browsers

Jerome McKenzie
Greenhorn

Joined: Nov 05, 2001
Posts: 2
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
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
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

- URGENT AS HELL, Jerry
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
The plugin is at the sun site.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing components and browsers
 
Similar Threads
Building a chess applet.
How Do I Install Swings On top on new Browsers?
Swing Vs AWT
free-hand drawing and swing
India Vs Australia