Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2005

Tip: Looking for answers? Try searching our database.

a stupid question

Thread view: 
patrick - 04 Apr 2005 18:59 GMT
When I click on link for .java file in the sun tutorials the file opens not
in my JBuilder IDE as it should do but in Internet Explorer as .htm page.

If I right click and 'Save target as' it can only be saved as .htm

Why is this?
Sounds like some setting in IE is overriding the .java file association with
JBuilder ??
.java is associated with JBuilder in my Control Panel.

TIA
patrick
kaeli - 04 Apr 2005 20:08 GMT
> When I click on link for .java file in the sun tutorials the file opens not
> in my JBuilder IDE as it should do but in Internet Explorer as .htm page.
[quoted text clipped - 5 lines]
> JBuilder ??
> .java is associated with JBuilder in my Control Panel.

Open a folder. My Documents will do.
Click on Tools -> Folder Options
Click on File Types tab.
Scroll down to JAVA.
Does it have JBuilder there?

Signature

--
~kaeli~
When you choke a smurf, what color does it turn?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

patrick - 04 Apr 2005 20:22 GMT
Yes it does.
patrick

>> When I click on link for .java file in the sun tutorials the file opens
>> not
[quoted text clipped - 13 lines]
> Scroll down to JAVA.
> Does it have JBuilder there?
kaeli - 05 Apr 2005 13:38 GMT
> Yes it does.
> patrick

Okay, post a url where it has a java file you're trying to get. I'll check
the headers and see if it's being sent as the right mime type.
MSIE ignores extensions if they send the wrong mime type, IIRC.
Did you try Firefox or Netscape?

Signature

--
~kaeli~
Never mess up an apology with an excuse.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

patrick - 05 Apr 2005 19:36 GMT
http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ScrollD
emo.java


http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/SliderD
emo.java


These 2 example just display in my browser when i click them like this:

import java.awt.*; import java.awt.event.*; import javax.swing.*; import
javax.swing.border.*; /* * ScrollDemo.java is a 1.4 application that
requires these
etc etc

patrick

>> Yes it does.
>> patrick
[quoted text clipped - 3 lines]
> MSIE ignores extensions if they send the wrong mime type, IIRC.
> Did you try Firefox or Netscape?
patrick - 05 Apr 2005 20:12 GMT
On this page:

http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/

> http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ScrollD
emo.java

>
[quoted text clipped - 17 lines]
>> MSIE ignores extensions if they send the wrong mime type, IIRC.
>> Did you try Firefox or Netscape?
"." - 05 Apr 2005 20:40 GMT
Patrick,

You have two options. Get a different browser or figure ways around the
stupidity of IE. I have .java files set for my IDE but going to an HTML
link with a .java file displays it in the browser for me as well.

If you go to the page with all the links, i.e. the .../example-1dot4/
page, you can right click on the link and select Save target as... It will
default to HTML for the file type. You should be able to change this to
All Files. If you cannot try adding double quotes around the filename. For
example, if the file is bob.java then enter "bob.java" in the save dialog.

This works in most Microsoft applications. When you wrap the filename in
double quotes it ignores the File Type setting and saves it as named.

Another stupid feature of Windows is hiding known file extensions. If this
feature is turned on and the file is named bob.java.html you will see
bob.java in the Windows Explorer but when you double click it, it will
open in IE because it is really bob.java.html. I ALWAYS turn off this
feature. Go to Windows Explorer, select Tools->Folder Options, go to the
View tab, unselect "Hide file extensions for known file types". As a
developer I also like to see hidden and system files so I change those
settings as well.

> On this page:
>
[quoted text clipped - 28 lines]
> >> http://www.ipwebdesign.net/wildAtHeart
> >> http://www.ipwebdesign.net/kaelisSpace

Signature

Send e-mail to: darrell dot grainger at utoronto dot ca

patrick - 06 Apr 2005 08:44 GMT
Yes that solves my problem simply enough.
That thing about file extensions has been mystifying me for years.
So I display the full file extension,
Save Target as, change to all files, replace the .htm with .java and the
save then
works properly.
IE must replave the .java with .htm  at some point which is not very
sensible.

thanks
patrick

> Patrick,
>
[quoted text clipped - 56 lines]
>> >> http://www.ipwebdesign.net/wildAtHeart
>> >> http://www.ipwebdesign.net/kaelisSpace
kaeli - 06 Apr 2005 15:06 GMT
> Yes that solves my problem simply enough.
> That thing about file extensions has been mystifying me for years.
[quoted text clipped - 4 lines]
> IE must replave the .java with .htm  at some point which is not very
> sensible.

Actually, in mine, it doesn't change the extension when I do "save target
as". It saves as Java (.java). In Windows Explorer File Types, I have file
extensions showing and I have hidden systems folders showing.

I just can't get the stupid thing (MSIE) to prompt me what I want to do with
the file when I click the link. If I click the link, it just opens in MSIE. I
have to right click and do "save target as". Annoying.

Signature

--
~kaeli~
Quantum Express: When you absolutely, positively, don't
know where it's going or when it needs to be there.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

kaeli - 05 Apr 2005 22:11 GMT
> http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ScrollD
emo.java

>
> http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/SliderD
emo.java

>
> These 2 example just display in my browser when i click them like this:

Okay, firefox prompted me as expected and MSIE opened the damn thing as text
and I couldn't get around it, as you experienced.

Looks like yet another MSIE PITA setting or something...
The thing is, clicking properties, MSIE knows darn well it's a java source
file and says so!
(properties -> type: Java Source File)

My guess: I know that at least once I opened a .java file in MSIE and it
prompted me what I wanted to do and I told it to open in the window and I
clicked "don't ask again". Oops.

If I had more time, I'd try to putz with it, but for now I'd have to
recommend you get a real browser.  :)
http://www.mozilla.org/products/firefox/

I might come play with it again tomorrow if I have a chance just to see if I
CAN fix it. It's probably a registry setting.

Oh, if you want to copy and paste it from MSIE and are seeing the nasty
formatting I saw when I first pulled it up, right click in the window and
choose automatic encoding (encoding->auto-select). At least it keeps the
formatting nicer that way.

Signature

--
~kaeli~
It was recently discovered that research causes cancer in
rats.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

patrick - 06 Apr 2005 08:03 GMT
kaeli,
thanks for all that.

Switch to Firefox i suppose is the answer.
It may be something to do with IE attempt at stopping popups which I know
nothing about....
Im fairly sure this used to work fine in IE.
patrick

>> http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ScrollD
emo.java

>>
[quoted text clipped - 27 lines]
> choose automatic encoding (encoding->auto-select). At least it keeps the
> formatting nicer that way.
Rakotomandimby (R12y) Mihamina - 05 Apr 2005 09:33 GMT
( Mon, 04 Apr 2005 18:59:14 +0100 ) patrick :

> When I click on link for .java file in the sun tutorials the file opens not
> in my JBuilder IDE as it should do but in Internet Explorer as .htm page.
> If I right click and 'Save target as' it can only be saved as .htm
> Why is this?

May be because the java file you think to get is an HTMLized java code
source?

Just make IE display it and then "Select all", Copy and Paste.

> .java is associated with JBuilder in my Control Panel.

Can you assume the link you click on is a .java file? not a .html? sure?

Signature

Les serveurs avec 10Mb/s se louent maintenant pour 50 ou 60 Euros par mois!
La preuve http://www.google.fr/search?q=serveur+dedie 
Infogerance de serveur dedie   http://aspo.rktmb.org/activites/infogerance
(En louant les services de l'ASPO vous luttez contre la fracture numerique)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.