• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is applet on some browsers...  RSS feed

 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
give my TicTacToe game a different appearance.
Here's the web site: http://snydb2001.freeservers.com/TicTac.html
and here's the code. Thanks for the help. I've been looking everywhere for the answer. Maybe using swing is the answer? I think not because isn't swing not recognized on all plu-ins?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian,
I have not tested this thouroghly ( since I am at work and the only browser installed is IE4 ), but I do not think that it is a problem with your applet... I think it is a problem with your HTML... there is a table around the applet, and from what I remember IE and Netscape display tables very differently. Just remove the table tags and just put the caption in as text.
Also, it would help alot if you described exactly what you meant by "different appearance"... I am assuming you mean the freaky gray/darkgray box that IE puts around your applet. The solution above should fix this.
-Nate
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nathan. I'll try it out.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hmmmmm....I saw the so called freaky box even in NS.....
so whats' that you see different
- satya
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhav,
I have Netscape 4.76 at home, so when I access it from my browser, I et a white background. I have had other people access it and it starts with a grey background, and as the players click on theor boxes it changes to white. The speed is also much slower. I was wondering why is it different on some other browsers. I though Java was platform independent and there by making it equally accessable from all platforms/browsers???
Thanks again Nathan and Madhav for your responses!!!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java gets it's code platform independance by insisting that the vendor JVM handle all of the messy details about how to interact with the OS. Each vendor writes it's own JVM for it's browser according to the specifications that Sun publishes, and they have some leeway in the way that they conform to those specifications including the look and feel.
In addition you are using the AWT which is all heavyweight components. This means that for each java component that you create the OS creates a "peer component" that interfaces with the OS. So if you run your App on a PC the buttons will look like windows buttons, but if you run it on a Unix box the buttons will look like Motif buttons.
Swing remedied this by making all of the components lightweight, so that there is NO peer component behind it. In addition to making it more efficient the look and feel stays consistant from JVM to JVM.
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cindy.
I did use AWT and not swing because I was practicing for the exam. After I pass, I will use swing. It appears to be much easier and runnable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!