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 / GUI / March 2008

Tip: Looking for answers? Try searching our database.

Location of image files in Java SRC

Thread view: 
Chanchal - 17 Mar 2008 12:11 GMT
Hello

i have instaled Java 1.6 along with source code, in c:\program
files. .Can somebody tell me which is the location where the icon
files are stored...
thanks

Chanchal
Andrew Thompson - 17 Mar 2008 12:45 GMT
...
> i have instaled Java 1.6 along with source code, in c:\program
> files. .Can somebody tell me which is the location where the icon
> files are stored...

(That would be a properly formed question
if only you'd added a '?' at the end!)

What are the images you are interested in?
The 'coffee cup' icon used for frames?
The start-up splashes used for applets or
web start apps.?

What is the advantage of knowing the location
of any images that Java uses?  Sun is not inviting
us to use them for our own purposes, though if
you want some special icons to represent
'This App. is Java Powered' or variants, I
think Sun offers a few.  e.g.
<http://logos.sun.com/en/logosite.jsp?Category=third&Logo=get-
java&Page=request2>

or..
>http://logos.sun.com/en/logosite.jsp?Category=third&Logo=get-java&Page=request2

(damn I hate Google)

--
Andrew T.
PhySci.org
Chanchal - 17 Mar 2008 15:12 GMT
Apologies for not putting the "?" mark.

Actually i'm developing some dialog boxes which will be much like the
option dialog boxes in swing. So i thought if i can use the same icons
as that in the swing option dialogs, user experience will be much
consistant.

My original problem is like this. In my application, the locale of the
appliaction is decided by a language selection the user makes while
logging in. The situation i'm facing is, when the application is
running on operating system with German locale, and the user selects
the language English, the button text is getting displayed in german,
and messages in English. Any suggestion on how this can be resolved
will be much apreciated.

Thanks and Regards

Chanchal
Andrew Thompson - 17 Mar 2008 15:22 GMT
...
> Actually i'm developing some dialog boxes which will be much like the
> option dialog boxes ..

Would that be a JOptionPane you are referring to?

>..in swing. So i thought if i can use the same icons
> as that in the swing option dialogs, user experience will be much
> consistant.

That makes sense.

> My original problem is like this. In my application, the locale of the
> appliaction is decided by a language selection the user makes while
[quoted text clipped - 3 lines]
> and messages in English. Any suggestion on how this can be resolved
> will be much apreciated.

As far as the language of text goes, I'd look to ..
<http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

<http://java.sun.com/docs/books/tutorial/i18n/index.html>

--
Andrew T.
PhySci.org
Chanchal - 18 Mar 2008 05:39 GMT
Dear Mr.Thompson,

For the messages which are displayed on the message box, i'm using
resource bundle and messages are being displayed in the correct
language. The problem i'm facing is with the text on button of the
message box. It seems that they are displayed based on the locale of
the Operating System. Or is there any way i can set the locale ofthe
whole application, so that button text will be shown in teh correct
language?

Thanks again

Chanchal
Andrew Thompson - 18 Mar 2008 06:06 GMT
> Dear Mr.Thompson,

Uggh.. (shudders) the only people that usually
call me 'Dear Mr. Thompson' are debt collection
agencies.  The best way to refer to people around
usenet is 'not to', or to simply 'Quote' some
text they wrote and reply to it. (see above, it is
clear who said what, from teh bit that reads..
"On ... Chanchal .. wrote:").

> For the messages which are displayed on the message box,

Message box, now dialog box..

I asked you before..
"Would that be a JOptionPane you are referring to?"

I want to know what specific J2SE Java class
you are using to develop these 'boxes'.

(exasperated) ..And you have never bothered to
answer that *question*.

Please answer my question, so I can muster
the strength and fortitude to continue this
thread..

Or if anybody else feels they can help better
(looks around) don't be afraid to jump in.
The OP seems a nice chap, and I (probably)
won't bite you.

--
Andrew T.
PhySci.org
Chanchal - 18 Mar 2008 08:25 GMT
> "Would that be a JOptionPane you are referring to?"
>
> I want to know what specific J2SE Java class
> you are using to develop these 'boxes'.

What i plan to do is to extend JDialog and create a dialog box that
looks like the one diplayed by the JOptionPane.showMessageDialog()
method
Andrew Thompson - 18 Mar 2008 11:04 GMT
> > "Would that be a JOptionPane you are referring to?"
>
[quoted text clipped - 4 lines]
> looks like the one diplayed by the JOptionPane.showMessageDialog()
> method

Thanks for answering my question.  :-)

I think Axel has identified the root answer
to this problem.  Try setting the default
locale and using a JOptionPane.

--
Andrew T.
PhySci.org
Chanchal - 18 Mar 2008 13:25 GMT
> I think Axel has identified the root answer
> to this problem.  Try setting the default
> locale and using a JOptionPane.

Actually that's exacltly what i have done. But still the button text
seems to go along with the locale of the OS. :-(

Chanchal
Andrew Thompson - 18 Mar 2008 15:53 GMT
> > I think Axel has identified the root answer
> > to this problem.  Try setting the default
> > locale and using a JOptionPane.
>
> Actually that's exacltly what i have done. But still the button text
> seems ..

..seems?  How about backing that up with *source*, ..

>...to go along with the locale of the OS. :-(

..like

<sscce>
import javax.swing.*;
import java.util.Locale;

class LocaleTest {

 public static void main(String[] args) {
   Locale.setDefault(Locale.GERMAN);   // "Ja/Nein"
   //Locale.setDefault(Locale.ITALIAN);  // "Si/No"
   //Locale.setDefault(Locale.FRENCH);   // "Oui/Non"

   JOptionPane jop = new JOptionPane(
     "Message",
     JOptionPane.INFORMATION_MESSAGE,
     JOptionPane.YES_NO_OPTION
     );

   JDialog dialog = jop.createDialog(
     null,
     "Title");
   dialog.setVisible(true);

 }
}
</sscce>

What result are you getting for German there?
(Or either of the other two commented locales).

--
Andrew T.
PhySci.org
Sabine Dinis Blochberger - 19 Mar 2008 10:40 GMT
> Dear Mr.Thompson,
>
[quoted text clipped - 9 lines]
>
> Chanchal

If the JVM can't find the value specified in the corresponding resource
bundle, it will use the one in the default bundle.

For example

 String locText = java.util.ResourceBundle.getBundle(
     "eu/op3racional/op3MI/resources/displayStrings")
     .getString("ds_label_nogroup");

if ds_label_nogroup is not in the resource bundle according to the
current locale, it will try to get it from the default bundle. It will
throw an exception if it doesn't exist anywhere, so you might want to
check your debug output.

Signature

Sabine Dinis Blochberger

Op3racional
www.op3racional.eu

Thomas A. Russ - 20 Mar 2008 19:29 GMT
> For the messages which are displayed on the message box, i'm using
> resource bundle and messages are being displayed in the correct
[quoted text clipped - 3 lines]
> whole application, so that button text will be shown in teh correct
> language?

What happens when you run the example code that was posted here?

Are you changing the locale before or after you create the dialog
object?  Once it's created, it's probably too late to change the locale
and expect the already existing buttons to be updated.

Signature

Thomas A. Russ,  USC/Information Sciences Institute

Axel Hallez - 18 Mar 2008 09:47 GMT
> My original problem is like this. In my application, the locale of the
> appliaction is decided by a language selection the user makes while
[quoted text clipped - 3 lines]
> and messages in English. Any suggestion on how this can be resolved
> will be much apreciated.

You can change the locale with this method:
Locale.setDefault(locale);

Kind regards,
Axel Hallez
Roedy Green - 18 Mar 2008 06:09 GMT
On Mon, 17 Mar 2008 04:11:45 -0700 (PDT), Chanchal
<chanchal.jacob@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>i have instaled Java 1.6 along with source code, in c:\program
>files. .Can somebody tell me which is the location where the icon
>files are stored...
>thanks

I usually put them in

com/mindprod/myproject/image/

for one or two images you might put them in
com/mindprod/myproject/
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



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.