Page 2 of 2 FirstFirst 12
Results 21 to 39 of 39
Like Tree1Likes

Thread: Dialog box in programs using JOptionPane and Jrame is not showing what's in my code

  1. #21
    shiri4frnz is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    0

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by DarrylBurke View Post
    Another metric could be to sysout the LookAndFeel.
    Java Code:
    System.out.println(UIManager.getLookAndFeel().getName());
    With enough relevant information, I still hope we can get to the bottom of this.

    db
    Java Code:
    import javax.swing.UIManager;
    
    class Test {
    
    	public static void main(String[] args) {
    
    		System.out.println(UIManager.getLookAndFeel().getName());
    
    	}
    
    }
    I executed the code of line mentioned by you and it displayed the following output

    Metal

  2. #22
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,862
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Have a look in the jre/lib directory for the java version you are running.
    I think that's where it draws a lot of its settings.
    Everything in there ought to have the same time stamp (the time stamp would be the last installation date).
    Flailing a bit, but there are font-related things in there, as well as a fonts directory (which is probably worth checking).
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #23
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by Tolls View Post
    there are font-related things in there, as well as a fonts directory
    I'd never noticed that. Yes, considering all that has already been checked, that's a prime suspect.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #24
    shiri4frnz is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    0

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by Tolls View Post
    Have a look in the jre/lib directory for the java version you are running.
    I think that's where it draws a lot of its settings.
    Everything in there ought to have the same time stamp (the time stamp would be the last installation date).
    Flailing a bit, but there are font-related things in there, as well as a fonts directory (which is probably worth checking).
    I am using jre7, there's an 'ext' folder that has a different time stamp.It has 6 files in it that have different time of modification and creation than the rest.the time of creation is earlier than the time of modification in each of them and both the times are same in every file.The time of modification is same in every file in the 'jre7' folder, but the time of modification is different in these 6 files.
    Yes,there is a font directory with just one font file in it that is 'LucidaSansRegular'.

  5. #25
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,862
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Is that font file the same date stamp as the various file in the directory above it?
    You should have the idea anyway.

    I don't have 7 on this machine, so no idea of the directory structure.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #26
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by shiri4frnz View Post
    Yes,there is a font directory with just one font file in it that is 'LucidaSansRegular'.
    That's strange. My .../jre7/lib/fonts folder has 8 files, all Lucida variants. Did you open your 'LucidaSansRegular' file to view the font?

    I have only one file in .../jre7/lib/ext with a differing timestamp and that's QTJava.zip. Nin .jar files and a met-index all have the same timestamp as all the other jre files.

    Hm, reviewing the two screenshots, neither of them have the expected bold text for the JLabels. Maybe we're getting somewhere.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #27
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    For comparison, here's a screenshot of the dialog on my computer. Note the bold font for the prompt and buttons.

    Dialog box in programs using JOptionPane and Jrame is not showing what's in my code-optionpane.png

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #28
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    See whether this article can guide you towards finding any unwanted font configuration:
    Font Configuration Files

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  9. #29
    shiri4frnz is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    0

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by DarrylBurke View Post
    That's strange. My .../jre7/lib/fonts folder has 8 files, all Lucida variants. Did you open your 'LucidaSansRegular' file to view the font?

    I have only one file in .../jre7/lib/ext with a differing timestamp and that's QTJava.zip. Nin .jar files and a met-index all have the same timestamp as all the other jre files.

    Hm, reviewing the two screenshots, neither of them have the expected bold text for the JLabels. Maybe we're getting somewhere.

    db
    I have those eight font files you are mentioning in ...\jdk1.7.0_04\jre\lib\fonts folder and they too seem normal to me.
    But i have just one 'LucidaSansRegular' file in my ...\jre7\lib\fonts folder which is normal too.

  10. #30
    shiri4frnz is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    0

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by DarrylBurke View Post
    See whether this article can guide you towards finding any unwanted font configuration:
    Font Configuration Files

    db
    I didn't get to know how to use this article to find my fault. Would you please explain it to me.

  11. #31
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,862
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    My jre6 only has the one font in that font directory (the same font as you) so, unless the timestamp on it is different, that's nothing unusual.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  12. #32
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by shiri4frnz View Post
    I have those eight font files you are mentioning in ...\jdk1.7.0_04\jre\lib\fonts folder and they too seem normal to me.
    But i have just one 'LucidaSansRegular' file in my ...\jre7\lib\fonts folder which is normal too.
    The font may be normal, but it's not normal that there's only one. Here's what I have:
    Dialog box in programs using JOptionPane and Jrame is not showing what's in my code-fonts.png

    I didn't get to know how to use this article to find my fault.
    Check all files named fontconfig in .../jer7/lib. A file with an extension of .bfc is a binary font configuration file, with virtually no human-readable information, but you could try replacing any fontconfig*bfc with a similarly named file from another computer that has the same OS and Java version (make sure to make a backup copy first).

    To recap, the fact that the dialog title is displayed correctly when the titlebar is managed by the OS, but is character-shifted when using the LaF titlebar, proves -- at least to me -- that this is a font issue and a font issue alone.

    The errant font may not be in a .ttf, .ttc or .fon file; if the file is identified in the # Font File Names section of a fontconfig*properties* file, Java doesn't care about the extension not matching what Windows would expect. Oh and note that those files can't be conveniently read in Notepad as they contain *n[ui]x line breaks which the archaic Notepad doesn't recognize. You will need to open the files in a word processor or code editor to be able to read them.

    Don't give up.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  13. #33
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by Tolls View Post
    My jre6 only has the one font in that font directory (the same font as you) so, unless the timestamp on it is different, that's nothing unusual.
    Oh. Then I have to wonder why I have all eight.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  14. #34
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,862
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    That was my x86 jre (which I don't use).
    The 64 bit ones all have the 8 fonts you show.

    Ooh.
    Wonder if that's something then?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  15. #35
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    I have a 32-bit OS so I only have the one jre7. My jre6/lib/fonts folder also has the eight fonts, as do both the jdk*/jre/lib/fonts folders.

    @shiri4frnz: In addition to all else, make sure you have the option to 'Show hidden files' turned on. Even though experience would suggest that Java can't access hidden files.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  16. #36
    shiri4frnz is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    0

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by DarrylBurke View Post

    The errant font may not be in a .ttf, .ttc or .fon file; if the file is identified in the # Font File Names section of a fontconfig*properties* file, Java doesn't care about the extension not matching what Windows would expect. Oh and note that those files can't be conveniently read in Notepad as they contain *n[ui]x line breaks which the archaic Notepad doesn't recognize. You will need to open the files in a word processor or code editor to be able to read them.

    Don't give up.

    db
    Here's what i found in the fontconfig.properties.src file under # Font File Names section
    Java Code:
    # Font File Names
    
    filename.Arial=ARIAL.TTF
    filename.Arial_Bold=ARIALBD.TTF
    filename.Arial_Italic=ARIALI.TTF
    filename.Arial_Bold_Italic=ARIALBI.TTF
    
    filename.Courier_New=COUR.TTF
    filename.Courier_New_Bold=COURBD.TTF
    filename.Courier_New_Italic=COURI.TTF
    filename.Courier_New_Bold_Italic=COURBI.TTF
    
    filename.Times_New_Roman=TIMES.TTF
    filename.Times_New_Roman_Bold=TIMESBD.TTF
    filename.Times_New_Roman_Italic=TIMESI.TTF
    filename.Times_New_Roman_Bold_Italic=TIMESBI.TTF
    
    filename.SimSun=SIMSUN.TTC
    filename.SimSun-18030=SIMSUN18030.TTC
    filename.SimSun-ExtB=SIMSUNB.TTF
    
    filename.MingLiU=MINGLIU.TTC
    filename.MingLiU-ExtB=MINGLIUB.TTC
    filename.PMingLiU=MINGLIU.TTC
    filename.PMingLiU-ExtB=MINGLIUB.TTC
    filename.MingLiU_HKSCS=hkscsm3u.ttf
    
    filename.David=DAVID.TTF
    filename.David_Bold=DAVIDBD.TTF
    
    filename.MS_Mincho=MSMINCHO.TTC
    filename.MS_PMincho=MSMINCHO.TTC
    filename.MS_Gothic=MSGOTHIC.TTC
    filename.MS_PGothic=MSGOTHIC.TTC
    
    filename.Gulim=gulim.TTC
    filename.Batang=batang.TTC
    filename.GulimChe=gulim.TTC
    
    filename.Lucida_Sans_Regular=LucidaSansRegular.ttf
    filename.Mangal=MANGAL.TTF
    filename.Symbol=SYMBOL.TTF
    filename.Wingdings=WINGDING.TTF
    
    filename.Sylfaen=sylfaen.ttf
    How may i proceed further?

    P.S. I would try that copying the .bfc file from another machine shortly too.

  17. #37
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by shiri4frnz View Post
    P.S. I would try that copying the .bfc file from another machine shortly too.
    Can't spot anything obviously wrong with the filenames.

    Don't forget what I said about keeping a backup. And do try to copy from a machine with the same OD and Java version.

    Thanks for staying with us -- I think by now I would have attempted something more drastic, like reinstalling the OS and everything else. To be honest, my primary interest in discovering a solution is that this is one of the rarest of rare problems, one for which no solution can (yet) be found by Google, so this thread could become very useful to anyone who encounters the same problem.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  18. #38
    shiri4frnz is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    0

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by DarrylBurke View Post
    Can't spot anything obviously wrong with the filenames.

    Don't forget what I said about keeping a backup. And do try to copy from a machine with the same OD and Java version.

    Thanks for staying with us -- I think by now I would have attempted something more drastic, like reinstalling the OS and everything else. To be honest, my primary interest in discovering a solution is that this is one of the rarest of rare problems, one for which no solution can (yet) be found by Google, so this thread could become very useful to anyone who encounters the same problem.

    db
    By the way, i too have a 32-bit OS just like you, so can you send me this .bfc file from your jre7??
    And in addition i have windows vista, hope that doesn't make any difference..

  19. #39
    shiri4frnz is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    0

    Default Re: Dialog box in programs using JOptionPane and Jrame is not showing what's in my co

    Quote Originally Posted by DarrylBurke View Post
    /taps foot impatiently

    db
    In somewhat similar situation..

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Default Focus in JOptionPane Dialog
    By Gajesh Tripathi in forum AWT / Swing
    Replies: 5
    Last Post: 11-11-2009, 02:59 PM
  2. Not-resizable (J)dialog showing Maximize Menu !!!
    By playwin2 in forum AWT / Swing
    Replies: 7
    Last Post: 09-08-2008, 12:51 AM
  3. JOptionPane dialog (Localizing)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-14-2008, 11:36 AM
  4. JOptionPane - message dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 09:11 AM
  5. JOptionPane - input dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 09:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •