Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Help With Java Applet, With XHTML 1.1/XHTML 1.0 Strict!
FirefoxRocks
post Apr 28 2007, 07:12 PM
Post #1


Super Member
Group Icon

Group: [HOSTED]
Posts: 738
Joined: 12-July 06
From: Ontario, Canada
Member No.: 14,464



I have a Java Applet for a chat room that is using the <applet> tag. It looks like it was from HTML 3.2 but I am using XHTML 1.1 (application/xhtml+xml), so I have to use the <object> element.

For now I have forced that page to load as XHTML 1.0 Transitional in text/html MIME type because I don't know how to fix the problem. I have tried many suggestions from many sites but they don't work in Firefox, Internet Explorer or Opera (some of them are IE-only but they still don't work in IE).

Is there any way that the <object> element can be implemented with cross-browser compatibility? I thought it would be as easy as <object> for Flash, but I guess not.
Go to the top of the page
 
+Quote Post
TavoxPeru
post Apr 29 2007, 10:56 AM
Post #2


Super Member
Group Icon

Group: [HOSTED]
Posts: 796
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:29.64



QUOTE(FirefoxRocks @ Apr 28 2007, 02:12 PM) *
I have a Java Applet for a chat room that is using the <applet> tag. It looks like it was from HTML 3.2 but I am using XHTML 1.1 (application/xhtml+xml), so I have to use the <object> element.

For now I have forced that page to load as XHTML 1.0 Transitional in text/html MIME type because I don't know how to fix the problem. I have tried many suggestions from many sites but they don't work in Firefox, Internet Explorer or Opera (some of them are IE-only but they still don't work in IE).

Is there any way that the <object> element can be implemented with cross-browser compatibility? I thought it would be as easy as <object> for Flash, but I guess not.

Well, take a look to the help section of the W3C Validator website, it has a lot of usefull tips, check How can I include flash in valid (X)HTML Web pages? and the Flash Satay technique, both of them are related to flash but i think that could help you.

Best regards,


Go to the top of the page
 
+Quote Post
FirefoxRocks
post Apr 29 2007, 07:19 PM
Post #3


Super Member
Group Icon

Group: [HOSTED]
Posts: 738
Joined: 12-July 06
From: Ontario, Canada
Member No.: 14,464



QUOTE(TavoxPeru @ Apr 29 2007, 05:56 AM) *
Well, take a look to the help section of the W3C Validator website, it has a lot of usefull tips, check How can I include flash in valid (X)HTML Web pages? and the Flash Satay technique, both of them are related to flash but i think that could help you.

Best regards,


I already use that method to incorporate Flash into my pages. I need help implementing a Java applet, not a Flash object. It doesn't work that way, I already tried it.
Go to the top of the page
 
+Quote Post
TavoxPeru
post Apr 30 2007, 05:10 AM
Post #4


Super Member
Group Icon

Group: [HOSTED]
Posts: 796
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:29.64



QUOTE(FirefoxRocks @ Apr 29 2007, 02:19 PM) *
I already use that method to incorporate Flash into my pages. I need help implementing a Java applet, not a Flash object. It doesn't work that way, I already tried it.

Sorry, take a look at the XHTML Reference - Object website for a complete reference.

Best regards,
Go to the top of the page
 
+Quote Post
FirefoxRocks
post May 1 2007, 12:59 PM
Post #5


Super Member
Group Icon

Group: [HOSTED]
Posts: 738
Joined: 12-July 06
From: Ontario, Canada
Member No.: 14,464



I know the attributes for <object>. I just don't know what to put in which attribute where.

Here is the original code that the site gives you:
HTML
<table border=0 width=500 align=center><tr><td>
<applet archive="http://www.freejavachat.com/java/cr.zip" codebase="http://www.freejavachat.com/java/" name=cr code="ConferenceRoom.class" width=500 height=300>
(some alternate text)
</applet>
</td></tr></table>
<br><center><a href="http://www.freejavachat.com">Free Chat</a> provided by freejavachat.com</center>


The main thing in there is the <applet>. I tried using:
HTML
<object archive="http://www.freejavachat.com/java/cr.zip" data="http://www.freejavachat.com/java/" name='cr' codebase="ConferenceRoom.class" style="width:500px;height:300px">
(some alternate text)
</object>


But it doesn't seem to work.

I have tried some other combinations of the <object> attributes but I haven't been able to get it right.
Go to the top of the page
 
+Quote Post
toby
post May 3 2007, 08:41 PM
Post #6


Super Member
Group Icon

Group: Members
Posts: 540
Joined: 29-September 06
Member No.: 16,228



Well, look at the params. Codebase for example, you gave it a totally different input. What happens when you use the <applet ... > from the first, then change applet to object?
Go to the top of the page
 
+Quote Post
FirefoxRocks
post May 5 2007, 06:35 PM
Post #7


Super Member
Group Icon

Group: [HOSTED]
Posts: 738
Joined: 12-July 06
From: Ontario, Canada
Member No.: 14,464



QUOTE(toby @ May 3 2007, 03:41 PM) *
Well, look at the params. Codebase for example, you gave it a totally different input. What happens when you use the <applet ... > from the first, then change applet to object?


I changed codebase because the codebase referred to in <applet> is actually the data of the object. And if I just change the element name from <applet...> to <object...> then it will still not function properly.
Go to the top of the page
 
+Quote Post
bluefish
post May 6 2007, 07:30 PM
Post #8


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 71
Joined: 16-December 06
Member No.: 18,419



Ok, here's what I got from one website:

CODE
XHTML (using object tag)


      <!--[if !IE]>-->
      <object classid="java:Sample2.class"
              type="application/x-java-applet"
              height="300" width="450" >
      <!--<![endif]-->
        <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                 height="300" width="450" >
          <param name="code" value="Sample2" />
        </object>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->


You could use some sort of JavaScript to display the correct one.

The site is http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html if that's not exactly what you're looking for (they have more).

This post has been edited by bluefish: May 6 2007, 07:31 PM
Go to the top of the page
 
+Quote Post
vizskywalker
post May 7 2007, 02:03 AM
Post #9


Techno-Necromancer
Group Icon

Group: Members
Posts: 1,018
Joined: 13-January 05
From: The Net
Member No.: 2,127



It looks like the above method is the best bet. I'm very disappointed in the lack of full support of objects in browsers. For example, there are some tricks that use inline frames which should be able to use objects, but unfortunately, changing parameters via javascript doesn't cause the object to be reloaded, and I have yet to find a way to reload objects manually. But I think merging the above method with the Flash-Satay method should yield good results, especially since streaming Java applets is usually not possible anyway.

~Viz
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. java.lang.NullPointException(4)
  2. Using system date in java... How?(5)
  3. Converting HTML over to XHTML(13)
  4. Array Sorting(21)
  5. What Are The Advantages Of Java Vs C++?(15)
  6. Understanding Xhtml(8)
  7. Java Applets(5)
  8. A Complete Java Tutorial(4)
  9. Need Help: Find Lowest Character Using Java(7)
  10. Download Java Ebooks(15)
  11. Java By Example(8)
  12. Looking For A Java IDE(25)
  13. How To Create Exe File In Java?(13)
  14. Mixing XHTML 1.1 And iFrame(9)
  15. Juggling An Iframe Box With Xhtml Sites(8)
  1. Counting Down To A Time(7)
  2. Graphcal User Interfaces In Java(4)
  3. Java Applet Loading Error(5)
  4. Setting Up Java Correctly(8)
  5. Java Java.security.accesscontrolexception(6)
  6. Simple Java Question(3)
  7. Java And Sql: Data Mismatch(6)
  8. Java Memory Leak?(2)
  9. Good Book For Learning Xhtml & Css(2)
  10. Php To Java(5)
  11. Java Mouse Movement.(2)
  12. How To Validate The Login Form Using Php Pcre(0)
  13. How To Design The Popup Menu Item Using Javascript(1)(0)


 



- Lo-Fi Version Time is now: 23rd November 2008 - 05:18 PM