Using JDK 1.5 in frame font is appearing different as it is coming in 1.4

When I am going to compile my application using jdk 1.4 and 1.5 both,in 1.5 fonts in my application component like frame,dialog fonts are appearing in different manner means in 1.5 it is appearing in bolder manner.
We are developing framework application and we have to give release for jdk 1.5 version but it is giving font difference.
Please resolve this issue because it is very urgent and critical.
this is not our framework problem i have developed one below simple application and compiled it in jdk 1.4 and 1.5 it is showing font difference.
Fonts like times new roman and arial etc are coming in bolder manner means more width but height and style is same.
i have snapshot also but i am not able to paste becasue editor is not accepting images.
I am giving you small program that will reproduce defect apart from my application.
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.Graphics;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.SwingConstants;
public class WizardDemo14
public static void main(String[] args)
JFrame dlg = new JFrame("COMPILED IN 1.5");
JLabel jLabel1 = new JLabel();
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 50));
jLabel1.setForeground(Color.blue);
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setHorizontalTextPosition(SwingConstants.CENTER);
jLabel1.setText("Finish...");
dlg.getContentPane().setLayout(new BorderLayout());
dlg.getContentPane().add(jLabel1);
dlg.setSize(400 ,400);
dlg.setVisible(true);
dlg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Please help me
Edited by: umesh3077 on Apr 2, 2008 6:44 AM

Below taken directly from the v1.6x API java.awt.Font class doco:he Java Platform distinguishes between two kinds of fonts: physical fonts and
logical fonts.
Physical fonts are the actual font libraries containing glyph data and tables to
map from character sequences to glyph sequences, using a font technology
such as TrueType or PostScript Type 1. All implementations of the Java
Platform must support TrueType fonts; support for other font technologies is
implementation dependent. Physical fonts may use names such as Helvetica,
Palatino, HonMincho, or any number of other font names. Typically, each
physical font supports only a limited set of writing systems, for example, only
Latin characters or only Japanese and Basic Latin. The set of available
physical fonts varies between configurations. Applications that require specific
fonts can bundle them and instantiate them using the createFont method.
Logical fonts are the five font families defined by the Java platform which must
be supported by any Java runtime environment: Serif, SansSerif, Monospaced,
Dialog, and DialogInput. These logical fonts are not actual font libraries.
Instead, the logical font names are mapped to physical fonts by the Java
runtime environment. The mapping is implementation and usually locale
dependent, so the look and the metrics provided by them vary. Typically, each
logical font name maps to several physical fonts in order to cover a large range
of characters.
Peered AWT components, such as Label and TextField, can only use logical
fonts.
For a discussion of the relative advantages and disadvantages of using
physical or logical fonts, see the Internationalization FAQ document.

Similar Messages

  • How to retrieve Font info using JDK

    Hello there:
    I am wondering how I can find as much info about a font as I can using JDK. I can use
    GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    to retrieve the Font object, and get its name, family, that's pretty much of it. There is getAttributes, but I am not sure how it works. If I want to know such info as the folder containing a particular font, the font's foundry, etc, I don't know how to get them.
    Anyone can point me to a right direction and maybe I can take from there.
    Thanks a lot,
    Sway

    thanks man, but i need more info about a font than that. Anyway I've found sun's API helpful to some extend.
    http://www.docjar.com/docs/api/sun/font/package-index.html

  • Disappearing Images on JButtons using JDK 1.4.0

    Here is the Java Swing Button example from java.sun.com:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.AbstractButton;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.ImageIcon;
    public class ButtonDemo extends JPanel
    implements ActionListener {
    protected JButton b1, b2, b3;
    public ButtonDemo() {
    ImageIcon leftButtonIcon = new ImageIcon("images/right.gif");
    ImageIcon middleButtonIcon = new ImageIcon("images/middle.gif");
    ImageIcon rightButtonIcon = new ImageIcon("images/left.gif");
    b1 = new JButton("Disable middle button", leftButtonIcon);
    b1.setVerticalTextPosition(AbstractButton.CENTER);
    b1.setHorizontalTextPosition(AbstractButton.LEFT);
    b1.setMnemonic(KeyEvent.VK_D);
    b1.setActionCommand("disable");
    b2 = new JButton("Middle button", middleButtonIcon);
    b2.setVerticalTextPosition(AbstractButton.BOTTOM);
    b2.setHorizontalTextPosition(AbstractButton.CENTER);
    b2.setMnemonic(KeyEvent.VK_M);
    b3 = new JButton("Enable middle button", rightButtonIcon);
    //Use the default text position of CENTER, RIGHT.
    b3.setMnemonic(KeyEvent.VK_E);
    b3.setActionCommand("enable");
    b3.setEnabled(false);
    //Listen for actions on buttons 1 and 3.
    b1.addActionListener(this);
    b3.addActionListener(this);
    b1.setToolTipText("Click this button to disable the middle button.");
    b2.setToolTipText("This middle button does nothing when you click it.");
    b3.setToolTipText("Click this button to enable the middle button.");
    //Add Components to this container, using the default FlowLayout.
    add(b1);
    add(b2);
    add(b3);
    public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("disable")) {
    b2.setEnabled(false);
    b1.setEnabled(false);
    b3.setEnabled(true);
    } else {
    b2.setEnabled(true);
    b1.setEnabled(true);
    b3.setEnabled(false);
    public static void main(String[] args) {
    JFrame frame = new JFrame("ButtonDemo");
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.getContentPane().add(new ButtonDemo(), BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);
    Do the following:
    1. Compile and run this example using JDK 1.4.0.
    2. While the frame is up hit the Control + Alt + Delete key sequence.
    3. Now hit the Escape Key.
    4. You will notice that atleast one of the buttons on the Java Swing Example will not have the image painted.
    Now if you force a repaint then the image(s) gets painted correctly.
    Any ideas?

    i've got exactely the same problem in a gui application running on windows nt 4, service pack 6. the problem of the disappearing icons occurs also after returning from the screen lock.
    if you got a solution in the mean time please let me know, thanks a lot
    matthiaszimmermann at yahoo.com

  • How do I use jdk 1.4 with weblogic 6.1?

    Want to use jdk 1.4 features(logging and regular expression) in a weblogic
              application I am developing. How do I get weblogic 6.1 to run with jdk1.4
              

              This is off topic but see the url below on edocs.
              You will need to make sure that your classpath points to the 1.4 jdk. Changing
              your $JAVA_HOME in the startup script is pretty much it.
              When developing your application, make sure your classpath is set properly .For
              example in the setExamplesSever.sh script you point to the 1.4 jdk.
              FYI This is not yet a supported platform.
              -frank
              http://e-docs.bea.com/wls/docs61/faq/java.html#251151
              "alt.cybercafes" <[email protected]> wrote:
              >Want to use jdk 1.4 features(logging and regular expression) in a weblogic
              >application I am developing. How do I get weblogic 6.1 to run with jdk1.4
              >
              >
              >
              

  • Need to save the image saved in the System Clipboard in using JDK 1.3.1

    Does anyone know how to use JDK 1.3.1 to take an image saved in the System clipboard and save it to a file using the JPG format?
    I know how it is done in JDK 1.4 using the following code. Unfortunately, the same code does not recognize the image in the clipboard in JDK 1.3.1
    I am using jai-1_1_2_01.
    package clipboard;
    import java.awt.datatransfer.Clipboard;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.Transferable;
    import java.awt.image.RenderedImage;
    import java.awt.Toolkit;
    import java.awt.datatransfer.UnsupportedFlavorException;
    import java.io.IOException;
    import java.io.FileOutputStream;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import javax.media.jai.JAI;
    import javax.media.jai.RenderedOp;
    public class clipboard
    {  private File tempFile = null;
    * @param args
    static int BUFFER_SIZE = 65536;
    public static void main(String[] args)
    {  clipboard clip = new clipboard();
    clip.writeImageFromClipboard();
    public void writeImageFromClipboard()
    {  Clipboard            clip = Toolkit.getDefaultToolkit().getSystemClipboard();
    Transferable transferable = clip.getContents(null);
    RenderedImage img = null;
    FileOutputStream fileOutStr = null;
    BufferedOutputStream bufOutStr = null;
    DataFlavor [] dataFlavors;
    File tempFile;
    int
    byteCount;
    String [] strArr;
    dataFlavors = transferable.getTransferDataFlavors();
    System.out.println("clip=" + clip.getName());
    System.out.println("Transferable=" + transferable);
    for (int i = 0; i < dataFlavors.length; i++)
    {  System.out.println("dataFlavours[" + i + "]=" + dataFlavors.toString());
    if (transferable.isDataFlavorSupported(new DataFlavor("image/x-java-image; class=java.awt.Image", "Image")))
    { try
    { img = (RenderedImage) transferable.getTransferData(new DataFlavor("image/x-java-image; class=java.awt.Image", "Image"));
    if (this.tempFile == null)
    { this.tempFile = File.createTempFile("__TMP_IMG__", ".jpg");
    System.out.println(this.tempFile.getCanonicalPath());
    fileOutStr = new FileOutputStream(this.tempFile);
    bufOutStr = new BufferedOutputStream(fileOutStr);
    // Encode the file as a JPG image.
    JAI.create("encode", img, bufOutStr, "JPEG", null);
    catch (UnsupportedFlavorException e)
    { e.printStackTrace();
    catch (IOException e)
    { e.printStackTrace();
    finally
    { if (bufOutStr != null)
    { try
    { bufOutStr.flush();
    bufOutStr.close();
    catch (IOException e)
    if (fileOutStr != null)
    { try
    { fileOutStr.flush();
    fileOutStr.close();
    catch (IOException e)
    else
    { System.out.println("Not an image!");

    The login  you connected to the server  and run the above statement does not have permissions to operate  on this path "C:\Users\ISLLCdba\Desktop\MAA
    PROFILE PICTURES\"
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • HT2509 Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the Mac Air? I need to be able to use a pop up window of fonts.

    Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the MacBook  Air? I need to be able to use a pop up window of fonts.

    Unless you've done anything to change it, Google keeps every email that ever passes through their server in your All Mail folder/mailbox/label. Even if you delete stuff, they hold onto it, there. You have to go out of your way to actually delete anything permanently.

  • To use one SessionInfo for multiple frames

    how to use one SessionInfo for master frame and other frame the detail
    Thanks for your reply.

    You can instantiate the SessionInfo and other dataproducer objects in frame1 and bind them to controls in the first and second frames.
    If you plan to change/execute queries pass the sessionInfo instance to the second frame.
    Hope this helps.
    Sathish
    null

  • I just bought a 13inch mac book with retina display. When Im using adobe illustrator or photoshop, the fonts and designs look pixelated! How can I fix this?

    I just bought a 13inch mac book with retina display.
    2.4GHz dual-core Intel Core i5 processor with 3MB shared L3 cache. Version 10.9.4 / OS X Mavericks
    When Im using adobe illustrator or photoshop, the fonts and designs look pixelated!
    How can I fix this?

    WOW!!
    That was great to hear.
    I have just read this tread: https://forums.adobe.com/thread/1626784?start=0&tstart=0
    So therefore I was worry about Illustrator which I use most of all programs.
    Thank you !!

  • I just "upgraded" my iPhone with the new software. As a low vision person, your phone was always previously helpful. I now discover that I cannot use the phone easily. The font has been changed to a very narrow typeface and the greyscale has been altered

    I just "upgraded" my iPhone with the new software. As a low vision person, your phone was always previously helpful. I now discover that I cannot use the phone easily. The font has been changed to a very narrow typeface and the greyscale has been altered to reduce contrast. The background is now grey as well rather than white. The accessibility options permit only three choices. First, increase type size. With the the low greyscale, thin typeface, increasing type size makes it HARDER to read. There is no option for contrast enhancement. Third, the background switch options suffers from the same deficit as the white background. The third choice is to enhance brightness but without the option to change contrast, this is useless. Am I missing something? Can this be fixed? How? When? Are you planning a similar negative "update"/change to other devices?

    I am having the same problem. I have gone through every setting, set the bold font, contrast, larger font....everything I could find in any post to try and help - and between the new color scheme that makes it virtually impossible to use the pictures of my grandchildren as background (the picture colors now become the theme colors - which now match the colors of many of the "flat" icons...) I am finding the phone very difficult to use--espeically things like the calendar which has now become very hard to "see" and use. If I can't revert this thing to iOS6, I may have to get a different phone.

  • When going from a Mac-based Ai to a PC based Ai, the documents "Font" are not found on the PC version?  (mostly Helvetica) where and how do I get those Fonts?  And/or, can I use the Mac version of these Fonts?

    When going from a Mac-based Ai to a PC based Ai, the documents "Font" are not found on the PC version?  (mostly Helvetica) where and how do I get those Fonts?  And/or, can I use the Mac version of these Fonts?
    Thanks, Rich

    In order to be cross platform you must be using the Open Type version of all fonts to cause the least disruption. Macs can read and process the Windows .ttf  type format but PCs can't process Mac formatted type. Most recent versions also cannot use the older PS Type 1 fonts.

  • How to use a non-standard true type font that won't be changed by the native environment on others' computers when they open the document?

    We are using a non-standard true type font (Zurich Ex BT) when creating a .pdf document but when others view it, the font is changed on their computers.  How do we use this font and keep it from being changed when others look at it?

    This is actually good stuff and well written but I hesitate to advise people to use either the "oven trick" or really even the heat gun method as both are notriously short-lived even if they appear effective. Your far better bet is to send the board in to one of the vendors on the internet who are set up to do a proper reball. Even those fixes are good for maybe 12-18 mos. But again, you get a high grade for spelling it out.

  • Can I copy one frame of a movie using iMove and save the frame as a file that can be printed like a picture?

    Can I copy one frame of a movie using iMovie and save the frame as a file that can be printed like a picture?  If so, how do I do that?

    You could if you want a postcard sized print.
    Printers need a lot more "dots" per inch and even a 1920X1080 video doesn't have enough "dots" to make more than a postcard.
    Look at the "More Like This" links at the right side of this page for instructions.

  • Problem using jdk included with JDEV9i

    I am trying to use jdk supplied with jdev9i release candidate 2 on my system
    (win 98).I have included c:\jde9i\jdk\bin in my system's path and c:\jdev9i\jdk\lib
    in my class path.
    But when I invoke compiler using javac it prints a long error message ,
    some of them are given below(I can't see the main exception because it scrolls up).
    Sun.misc.Resource Sun.misc.URLClassPath.getReasource(java.lang.String.boolean)
    java.lang.Object java.net.URLClassLoader$1.run()
    java.lang.Object java.security.AccessController.dePriviledged(java.security.
    PriviledgedExceptionAction,java.security.AccessControlContext)
    So how can I use this jdk to compile and run my other applications.

    Hi,
    My document looks as follows:
    <pre:inventory xmlns:pre="http://www.example.com/books">
    <pre:book year="2000">
    <pre:title>Snow Crash</pre:title>
    <pre:author>Neal Stephenson</pre:author>
    <pre:publisher>Spectra</pre:publisher>
    <pre:isbn>0553380958</pre:isbn>
    <pre:price>14.95</pre:price>
    </pre:book>
    <!-- more books... -->
    </pre:inventory>
    And I tried the following:
    //pre:book
    /pre:inventory and
    /pre:inventory/pre:book
    I have the necessaty code in my namespaceresolver as follows:
    public String getNamespaceURI(String prefix) {
            if (prefix == null)
                  throw new NullPointerException("Null prefix");
            else if ("pre".equals(prefix))
                   return "http://www.example.com/books";
            else if ("xml".equals(prefix))
                   return XMLConstants.XML_NS_URI;
              return XMLConstants.NULL_NS_URI;
                    cheers,
    ovisvana

  • URGENT!! ERROR WITH EXPIRED CERTIFICATE USING JDK 1.4.2.05

    Hi,
    I have created a client/server application with SSL and have found the following problem.
    I have made these two tests:
    1) jdk 1.4.2.03 --> the certificate is expired, I obtain this exception "No trusted certificate found". it's ok
    2) jdk 1.4.2.06 --> the certificate is expired, no error occurs. WHY?????
    Someone can help me?
    Gianna

    The problem is not the expired certificate! I know that it is expired, but I don't understand why using jdk 1.4.2.05 this certificate is not recognize invalid.
    With this jdk the channel is created. Using jdk 1.4.2.03 instead the certificate was recognized expired and the channel is not created between client and server.
    For me the correct behavior has with the old version of the JDK and not the new.
    WHY?????

  • Composition window suddenly is using a small (2-pt?) font--the font looks ok when sent.

    The message composition window suddenly is using a small (2-pt?) font. This happened "spontaneously" when replying to a message. It happens all the time now.
    When the sent message is viewed afterwards, the fonts are normal in size. When I increase the font size in the composition window, it looks huge after sending.
    I'm using a Mac with OS 10.9.2.
    Any ideas on restoring the font sizes in the composition window?

    Here's an image of the problem.

Maybe you are looking for

  • Can I put a 1 TB hard drive on my early 2011 8gb/2.4 ghz 13' macbook pro

    I would like to upgrade my early 2011 macbook pro with a 250 GB hard drive to a 1 TB drive.  Is this possible?  What internal hard drives will fit into the 13" macbook pro?  it has 8 GB of RAM and is the  2.4 GHZ model. Thanks Laurie

  • Boot Camp and Win XP help

    does anyone know any way around intalling windows xp professional that doesn't have service pack 2? I tried installing my old xp with SP1 using boot camp and it wont work, I can't imagine that I have to buy a whole new windows xp to be able to use it

  • Sort order differs on iPod

    I've just replaced my G2 iPod with a 60GB 5G iPod. The song sort order on the 'standard' playlists like 'Songs" (as opposed to the playlists I create myself) have a different sort order from how they're displayed in iTunes. For example, I sort 'Recen

  • Integrating oracle with NMS? --URGENT

    hi all! this is very urgent! i have 10g database running on rhel4. it is using the database control. We have Aprisma Spectrum working as the NETWORK MONITORING SYSTEM which uses SNMP POLLS. They are pulling info from all the servers using spectrum. I

  • I can't delete 2 photo albums from my Ipad 2...  What am I doing wrong?

    I can't delete 2 photo albums from my Ipad 2...  What am I doing wrong?  I go to the photo app, then albums and 2 show up, I tap edit and nothing happens...  I just want to delete these...