Fonts for Java

Hi,
I am a font developer, and Java developer as well. I have made some OpenType fonts for Windows 2000 that support Arabic Script ranges in Unicode 3.0. Now when I make a Java program on that machine, that uses this font, it works fine. But I can't use this application on other platforms, because my font is for Windows. Is there any why I can ship my font with my program, so that one can see same glyphs and ligatures on platforms other than Windows?

Hi,
I used Java to support Indian langauge of Kannada. And it works well in bothe IE and Netscape (and its plain AWT). I'm using a plain TTF for this. Its not a Unicode font. But with this approach, there is a problem.
Let me take an example to explain what I want to say. When I press the 'k' key I get 'ka' character displayed, which is made up of 2 glyphs. And now if I press BACKSPACE, only one of the 2 glyphs is deleted which is undesirable. Its the same case when you press DELETE key. So is the case for all other characters in all the Indian langauges. Here I'd like to know...
1. If the font were a opentype, could we bind the 2 glyphs into a group such that if any one of the glyphs is deleted, both the glyphs gets removed from the TextArea or TextField?
2. If the font were a opentype, can it be that if I press the 'k' key on the keyboard, the unicode value for 'ka' is inserted into the TextArea and the glyphs for 'ka' character is displayed?
Please reply.
Regards,
Harsha P. Ravnikar
[email protected]

Similar Messages

  • Deprecation warning for getFontMetrics(java.awt.Font) in java.awt.Toolkit

    Hi all,
    When I use the following code
    JComponent c;
    FontMetrics metrics = getToolkit().getFontMetrics(c.getFont());
    I get this following warning during compilation:-
    warning: getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
    JDK suggests to use getLineMetrics() of the Font class.
    But there's an issue with that: if I use getLineMetrics(), there is no API method that I can use to get the width of a string as opposed to FontMetrics which provides stringWidth(String str) method for that purpose. In fact all the methods in FontMetrics are not mapped into LineMetrics.
    Could anyone please help or provide me at least some pointers on how to tackle this issue so that I can get rid of the deprecated method along with the existing methods mapped to equivalent APIs? The bottomline is that I should be able to maintain the existing functinality of my application for those part of code that uses getToolkit().getFontMetrics().
    Thank you for your help in advance.
    -Sanjoy Das

    Use Graphics.getFontMetrics(font) instead.
    After creation your frame and calling frame.show();
    You can access it like that
    frame.show();
    frame.getGraphics().getFontMetrics(new Font("Arial",0,10));
    before showing graphics is null.
    Or just create a BufferedImage and ask it for graphics.
    BufferedImage img=new BufferedImage(...);
    img.getGraphics().getFontMetrics(font);
    regards
    Stas

  • Fonts in java apps for win and linux

    Hi everyone.
    i need to build an application mult-plataform, to run in windows and linux...
    but i don�t know waht font i must use...the default font that java takes doesn�t exist in linux (dialog)...
    waht font should i use in my app??
    thanx

    For going multi-platform it is easiest to stick to the logical fonts: Fonts named "Serif", "SansSerif", "Monospaced", "Dialog", and "DialogInput".
    These fonts are guaranteed to exist on any platform, although their implementations may be different. If you use others then you'll have to figure out how to deal with cross platform issues.
    Jeff

  • How can I select a smaller font for all components of a Swing application?

    The default size of font in Java Look and Feel is 12, how can I change it to 10 globally for my Swing application ?
    Thanks for your help.
    Helen

    It is not very simple because all components don't use the same fonts and if you don't want to subclass the l&f you can do this :
    after setting the l&f (in the main for example)
    Font f = new Font("dialog", Font.PLAIN, 11);
    UIManager.put("MenuItem.font", f);
    UIManager.put("Menu.font", f);
    UIManager.put("MenuItem.acceleratorFont", new Font("dialog", Font.PLAIN, 10));
    UIManager.put("Label.font", f);
    UIManager.put("Button.font", f);
    UIManager.put("ToggleButton.font", f);
    UIManager.put("ToolTip.font", f);
    UIManager.put("List.font", f);
    UIManager.put("Table.font", f);
    UIManager.put("TextField.font", f);
    UIManager.put("ComboBox.font", f);
    UIManager.put("RadioButton.font", f);
    UIManager.put("CheckBox.font", f);
    UIManager.put("RadioButtonMenuItem.font", f);
    UIManager.put("CheckBoxMenuItem.font", f);
    UIManager.put("TableHeader.font", f);
    UIManager.put("Spinner.font", f);
    UIManager.put("Panel.font", f);etc...
    Denis

  • True Type Fonts in Java

    Hi all
    I searched through the forum and found some threads with the same problem but never a solution attached so here is my question:
    I'm currently trying to use a True Type Font in Java. I installed the font under windows and it works fine in e.g. Word, but when I try to use it in Java all I can see are "rectangles". I'm not sure if the problem lies in the font itself or if it is a problem of Java. The fonts are named "Fughetta" and "Toccata" and can be found here: http://www.efn.org/~bch/aboutfonts.html. He is a code snippet I'm using to test the font:
    public void setFonts(Graphics g)
            if (f != null) {
                return;
            f = new Font("Fughetta", Font.TRUETYPE_FONT, 26);
            System.out.println(f);
        public void paintComponent(Graphics g)
            super.paintComponent(g);
            setFonts(g);
            String s1 = "1234567890��!\"�$%&/(()=?`";
            String s2 = "qwertzuiop�+asdfghjkl��#yxcvbnm,.-<";
            String s3 = "QWERTZUIOP�*ASDFGHJKL��'YXCVBNM;:_>";
            String s4 = "1��{[]\\}@�~�|";
            g.setFont(f);
            g.drawString(s1, 10, 30);
            g.drawString(s2, 10, 70);
            g.drawString(s3, 10, 110);
            g.drawString(s4, 10, 150);
        }All help is appreciated ;)
    - marc

    Hy, Thanks for your sollution, but now I can't use this kind of approach.
    I need to show a Bar Code Font inside a JTable cell, so I created my CellRenderer, in which I tried to change the font to my "Code EAN13" True Type font.
    public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus, int row, int column)  {
                 Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                 if (column == CollectInfoTableModel.CODBAREPRODUS_INDEX ) {
                         Font barCodeFont = new Font("Arial", Font.BOLD, 36);
                         c.setFont(barCodeFont);                 
    }This doesn't work, it just prints some strange characters.
    I tried your sollution, but when I make :
    Graphics2D g2D= (Graphics)c.getGraphics();i keep getting g2D = null.
    What can I do ?
    Is there a way to obtai a valid Grapics object on which to draw the glyphVector on ?

  • I need to know the standard default font for Firefox

    I had a Dell 20 inch 2007fp monitor that I had to give up. I purchased an LG 22inch widescreen monitor.
    My home page is the Drudge Report and with the new monitor the font is all messed up.
    What is the standard default font for Firefox?

    You can see the defaults in a screenshot in this KB article: [[Some text shows up bold after upgrade]]<br />
    You can check the font setting in: Tools > Options > Content : Fonts & Colors: Advanced<br />
    Default Font: Times New Roman (16)<br />
    <br />
    Fonts for : Western<br />
    <br />
    Proportional: Serif (16)<br />
    Serif : Times New Roman<br />
    Sans-serif : Arial<br />
    Monospace : Courier New (13)
    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Next Generation Java Plug-in 1.6.0_18 for Mozilla browsers
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)

  • PDF Assembly is not working for ddx :Unable to select font for character U+54 'T'

    Hi ,<br /><br />   I am getting the following error while generating the pdf. :<br /><br />Caused by: com.adobe.livecycle.assembler.client.ProcessingException: ALC-ASM-S00-002: Failed to execute the DDX - error messages provided.<br />     at com.adobe.livecycle.assembler.AssemblerServiceImpl.makeResult(AssemblerServiceImpl.java:6 74)<br />     at com.adobe.livecycle.assembler.AssemblerServiceImpl.execute(AssemblerServiceImpl.java:410) <br />     at com.adobe.livecycle.assembler.AssemblerServiceImpl.invokeDDX(AssemblerServiceImpl.java:29 0)<br />     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)<br />     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />     at java.lang.reflect.Method.invoke(Method.java:615)<br />     at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:181)<br />     ... 33 more<br />Caused by: com.adobe.internal.ddxm.DDXMException: DDXM_S18005: An error occurred in the PrepareTOC phase while building <TableOfContents>. Cause given.<br />     at com.adobe.internal.ddxm.task.toc.PrepareTOC.execute(PrepareTOC.java:234)<br />     at com.adobe.internal.ddxm.blueprint.BluePrint.postExecute(BluePrint.java:306)<br />     at com.adobe.internal.ddxm.ddx.Node.execute(Node.java:353)<br />     at com.adobe.internal.ddxm.Executive.execute(Executive.java:244)<br />     at com.adobe.internal.ddxm.Executive.execute(Executive.java:192)<br />     at com.adobe.livecycle.assembler.AssemblerServiceImpl.execute(AssemblerServiceImpl.java:408) <br />     ... 39 more<br />Caused by: com.adobe.internal.pdfm.toc.TOCServiceException: PDFM_S18001: The operation of producing a table of contents failed.<br />     at com.adobe.internal.pdfm.toc.TOCServiceImpl.formatTOCContent(TOCServiceImpl.java:1877)<br />     at com.adobe.internal.pdfm.toc.TOCServiceImpl.getNumberOfTOCPages(TOCServiceImpl.java:1681)< br />     at com.adobe.internal.ddxm.task.toc.PrepareTOC.execute(PrepareTOC.java:217)<br />     ... 44 more<br />Caused by: com.adobe.fontengine.inlineformatting.FormattingException: Unable to select font for character U+54 'T', Requested attributes:Family=Arial|Size=12.0|Stretch=normal|Style=normal|Variant=normal|Weight=400|O TFDiscretionaryLigatures=minimum|WritingMode=lr-tb|BidiLevel=0|ScaleToFit=1.0|Shift=-none- <br /><br />would appreciate if anybody can help on this..<br /><br />Thanks & Regards<br />Masthan Shaik

    I think that all your form parameters must begin with alowercase letters, for example
    startOfSession instead of StartOfSession
    try to rename your selectname paramters.
    Le me know if ti works,
    Giovanni

  • Optional elements not supported in XML parser for java

    I am using v2 parser version 2.0.2.8.0 for java. Looks like this parser does not support optional elements.
    My DTD looks like
    <!ELEMENT Graph (Background, ImageSize)?>
    <!ELEMENT ImageSize EMPTY>
    <!ATTLIST ImageSize
    width CDATA #IMPLIED
    height CDATA #IMPLIED >
    <!ELEMENT Background EMPTY>
    <!ATTLIST Background
    fillColor CDATA #IMPLIED>
    If I set the XML following XML
    <?xml version="1.0" ?>
    <Graph>
    <ImageSize width="422" height="477"/>
    </Graph>
    I am getting XMLParseException :Invalid element 'ImageSize' in content of 'Graph', expected elements '[Background]'
    The parser expects all the elements to be present in the XML although the elements are defined as optional in the DTD. It used to work fine until v2 parser version 2.0.2.7.0. Is this a bug?
    null

    The value of JAXP is that it allows one to
    freely switch parsers without changing any code. I have an application that uses the JAXP interfaces to create my DOM parser. I am using the Xerces-J parser now. I wanted to try Oracle's parser to see how it compares. To my great surprise, I found the Oracle DOM parser doesn't support JAXP. Because of this I have to CHANGE my code to user the Oracle DOM parser. Thus defeating the purpose of coding my app to the JAXP interface.
    I have to add that I am surprised to see that a developer of Oracle's XML parser has to even ask what the value of JAXP is. I would think that being a parser developer, you would know and understand the value of JAXP.
    I would like to know why Oracle has chosen not to support JAXP? Or have you just not even thought about whether or not you should support it.
    Thanks,
    Keith Jensen
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    What is the perceived value in implementing the JAXP standard? We already implement SAX, have plans for SAX2, and are working with other XSLT vendors on the TRAX api for XSLT processors.
    If there is strong customer demand, we'll clearly consider it, but at the moment that has not been the case.<HR></BLOCKQUOTE>
    null

  • Printer Built-in fonts in java

    Hello,
    I'm using Imaje 2000 Series Printer, when opening a new microsoft word document I can see some built in fonts specific to that printer like Imaje Arial, Imaje Times New Roman B, etc... I found out when printing with one of these fonts, the printing process is very fast. what happens is that I can see those fonts with name Imaje in MS word with printer icon attached to them, but in java i cant see them, and to check all fonts in java i used the below code :
    Font[] f = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    for (int i=0; i<f.length; i++) {
    System.out.println(f.getFontName());
    if i try to set the font to Imaje Arial, java will neglect that font and print on the default I guess. Is there a way to use the printer built in fonts from within my java application

    well, i cant find the font in windows fonts
    directory, but when I open MS wrod i can find the
    font (for example: Imaje Arial) in the fonts list and
    has an icon of printer which means its not a true
    type font. and please note that this font Imaje Arial
    did not appear in MS word before installing the
    printer driver.Well, if it's not installed and you can't find the file, how do you expect Java to do it?

  • JAXP support in XML Parser for Java

    Was curious if there were any plans to support JAXP in the XML Parser for Java. Sun's licensing terms was a serious issue of contention when Apache was trying to implement the spec and finally got an exemption from Sun to some of the terms.

    The value of JAXP is that it allows one to
    freely switch parsers without changing any code. I have an application that uses the JAXP interfaces to create my DOM parser. I am using the Xerces-J parser now. I wanted to try Oracle's parser to see how it compares. To my great surprise, I found the Oracle DOM parser doesn't support JAXP. Because of this I have to CHANGE my code to user the Oracle DOM parser. Thus defeating the purpose of coding my app to the JAXP interface.
    I have to add that I am surprised to see that a developer of Oracle's XML parser has to even ask what the value of JAXP is. I would think that being a parser developer, you would know and understand the value of JAXP.
    I would like to know why Oracle has chosen not to support JAXP? Or have you just not even thought about whether or not you should support it.
    Thanks,
    Keith Jensen
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    What is the perceived value in implementing the JAXP standard? We already implement SAX, have plans for SAX2, and are working with other XSLT vendors on the TRAX api for XSLT processors.
    If there is strong customer demand, we'll clearly consider it, but at the moment that has not been the case.<HR></BLOCKQUOTE>
    null

  • Business Components for Java - Pooling

    I need a little bit of clarification regarding business components for java...
    I would like to create a jdbc connection pool for my application to avoid the overhead of creating new jdbc connections each time a client connects.
    Since I'm using BC4J, and the jdbc connect is contained within the bc4j components, I connect to the database using:
    session.getTransaction().connect("jdbc:oracle:thin:test/test@ccmain:1521:clincare");
    Does the BC4J architecture do any connection pooling itself? My plan was to create a pool of ApplicationModules that could be easily and quickly accessed, but if bc4j already pools the jdbc connections internally, then I'm not sure I would gain any performance with my ApplicationModule pool.
    Any input would be appreciated! Thanks!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steve Muench ([email protected]):
    [b]Does the BC4J architecture do any connection pooling itself?
    Strictly speaking, in JDev/BC4J 3.1, the answer is no. BC4J 3.1 offer Application Module pooling and since AM's are paired one to one with connections, using a pool of AM's is pretty much the same as using a pool of connections.
    However, in JDev 3.2 we've dramatically improved the features for use in a high-throughput Web application scenario and in doing so have implemented a more flexible application module pooling mechanism as well as a connection pooling mechanism that work together to allow developers to exploit application module instances to retain pending state without "pinning" that pending state to a particular AM instance and without "pinning" a dedicated database connection.
    Early customer previews we've done on our 3.2 features have been receving rave reviews, so we'll excited to get it out to a wider audience this Fall.
    For now, you're best bet is to exploit the application module pooling mechanism.<HR></BLOCKQUOTE>
    Is JDev 3.2 going to include a support for registering application module not from the property file, but using specific database username and password for the underlying connection ?

  • A small Java Problem for java Experts

    Hi Guys...
    I have a small problem with my program...
    Tha program I am using consist of several frames where one invokes the other in row.
    These are the classes I am using:
    the FIRST class://THIS CLASS IS NOT COMPLETE
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * LabelDemo.java is a 1.4 application that needs one other file:
    * images/middle.gif
    public class CSVloader extends JPanel implements ActionListener {
         ImageIcon icon ;
         JLabel label;
    JButton theButton1;
    JButton saveButton;
    JButton displayButton;
    JButton displayStyleButton;
    JFileChooser fc;
    final boolean shouldFill = true;
    final boolean shouldWeightX = true;
    public CSVloader() {
    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    setLayout(gridbag);
    if (shouldFill) {
    //natural height, maximum width
    c.fill = GridBagConstraints.HORIZONTAL;
    theButton1 = new JButton("Choose source File");
    theButton1.addActionListener(this);
    if (shouldWeightX) {
    c.weightx = 0.5;
    c.gridx = 0;
    c.gridy = 0;
    gridbag.setConstraints(theButton1, c);
    add(theButton1);
    displayStyleButton = new JButton("CSV Display style");
    displayStyleButton.addActionListener(this);
    c.gridx = 0;
    c.gridy = 2;
    gridbag.setConstraints(displayStyleButton, c);
    add(displayStyleButton);
    displayButton = new JButton("Display");
    displayButton.addActionListener(this);
    c.gridx = 1;
    c.gridy = 0;
    gridbag.setConstraints(displayButton, c);
    add(displayButton);
    saveButton = new JButton("Save");
    saveButton.addActionListener(this);
    c.gridx = 0;
    c.gridy = 1;
    gridbag.setConstraints(saveButton, c);
    add(saveButton);
    icon = new ImageIcon("c:/applets/CSVlogo.gif");
    //Create the first label.
    label = new JLabel(icon);
    c.ipady = 45; //make this component tall
    c.weightx = 0.0;
    c.gridwidth = 1;
    c.gridx = 1;
    c.gridy = 1;
    gridbag.setConstraints(label, c);
    add(label);
    fc = new JFileChooser();
    public Dimension getDimension(int hight, int width) {
    Dimension theDimension = new Dimension(hight,width);
    return theDimension;
    public void actionPerformed(ActionEvent e) {
    //Handle open button action.
    if (e.getSource() == theButton1) {
    int returnVal = fc.showOpenDialog(CSVloader.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file = fc.getSelectedFile();
    //This is where a real application would open the file.
    //Handle save button action.
    } else
    if (e.getSource() == displayButton) {
         try {
    Runtime.getRuntime().exec("cmd /c start " + "c:\\applets\\displayData.html");
    catch(IOException io)
    System.err.println("Caught IOException: " +
         io.getMessage());
    }else
    if (e.getSource() == displayStyleButton)
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("Display Style");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    DisplayStyle newContentPane = new DisplayStyle();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    else
    if (e.getSource() == saveButton) {
         int returnVal = fc.showOpenDialog(CSVloader.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    File saveFile = fc.getSelectedFile();
    //This is where a real application would open the file.
    public static void main(String[] args) {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("LabelDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    CSVloader newContentPane = new CSVloader();
    newContentPane.setBackground(Color.WHITE);
    newContentPane.setOpaque(true);
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    // Runtime.getRuntime().exec("cmd /c start " + "....\\docs\\index.html");
    this is the SECOND class:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DisplayStyle extends JPanel implements ActionListener{
         public static final int FIRST_OPTION = 0;
         public static final int SECOND_OPTION = 1;
         public static final int THIRD_OPTION = 2;
         public static final int THE_BUTTON_OPTION =3;
    public static final int ERROR = -1;
         public int selectedOption = ERROR;
         static String table = "Table";
         static String tableNoBorders = "Table without Borders";
         static String highlightedTable = "Highlighted Table without Borders";
         public JRadioButton theTable;
         public JRadioButton theTable2;
         public JRadioButton theTable3;
         public JButton theButton;
         public String theName;
         public DisplayStyle ()
         theTable = new JRadioButton(table);
         theTable.setActionCommand(""+ FIRST_OPTION);
         theTable.addActionListener(this);
         theTable.setMnemonic(KeyEvent.VK_B);     
    theTable.setSelected(true);
    theTable2 = new JRadioButton(tableNoBorders);
    theTable2.setActionCommand(""+ SECOND_OPTION);
         theTable2.addActionListener(this);
         theTable2.setMnemonic(KeyEvent.VK_B);     
    theTable3 = new JRadioButton(highlightedTable);
    theTable3.setActionCommand(""+ THIRD_OPTION);
         theTable3.addActionListener(this);
         theTable3.setMnemonic(KeyEvent.VK_B);     
    theButton = new JButton("OK");
    theButton.setActionCommand(""+ THE_BUTTON_OPTION);
    theButton.addActionListener(this);
         ButtonGroup group = new ButtonGroup();
    group.add(theTable);
    group.add(theTable2);
    group.add(theTable3);
    JLabel theLabel = new JLabel("Choose the style of Display");
    JPanel radioPanel = new JPanel(new GridLayout(0, 1));
    radioPanel.add(theLabel);
    radioPanel.add(theTable);
    radioPanel.add(theTable2);
    radioPanel.add(theTable3);
    radioPanel.add(theButton);
    add(radioPanel, BorderLayout.LINE_START);
         public void actionPerformed (ActionEvent e) {
         if(e.getSource() == theButton)
         JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame1 = new JFrame("The Format");
    frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Formats newFormat = new Formats();
    newFormat.setOpaque(true); //content panes must be opaque
    frame1.setContentPane(newFormat);
    //Display the window.
    frame1.pack();
    frame1.setVisible(true);
         selectedOption = Integer.parseInt(e.getActionCommand().trim());
         public DisplayStyle getInstance(){
              return this;      
    this is the THIRD class:
    mport java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Formats extends JPanel implements ActionListener{
         public static final int FIRST_OPTION = 0;
         public static final int SECOND_OPTION = 1;
         public static final int THIRD_OPTION = 2;
         public static final int FOURTH_OPTION = 4;
         public static final int THE_BUTTON_OPTION =3;
    public static final int ERROR = -1;
         public int selectedOption = ERROR;
         static String standardFormat = "Date first";
         static String timeFirstFormat = "Time First";
         static String typeFirstFormat = "Type of call first";
         static String extFirstFormat = "Extension first";
         public JButton theButton;
         public JRadioButton theStandardButton1 ;
         public JRadioButton theTimeButton;
         public JRadioButton theTypeButton;
         public JRadioButton theExtButton ;
         public Formats()
    theStandardButton1 = new JRadioButton(standardFormat);
         theStandardButton1.setMnemonic(KeyEvent.VK_B);     
    theStandardButton1.setSelected(true);
         theTimeButton = new JRadioButton(timeFirstFormat);
         theTimeButton.setMnemonic(KeyEvent.VK_B);     
    theTypeButton = new JRadioButton(typeFirstFormat);
         theTypeButton .setMnemonic(KeyEvent.VK_B);     
    theExtButton = new JRadioButton(extFirstFormat);
         theExtButton.setMnemonic(KeyEvent.VK_B);     
         ButtonGroup group = new ButtonGroup();
    group.add(theStandardButton1);
    group.add(theTimeButton);
    group.add(theTypeButton);
    group.add(theExtButton);
    JLabel newLabel = new JLabel("Choose the Format type for the data to be displayed");
    theButton = new JButton("OK");
    theButton.addActionListener(this);
    theButton.setActionCommand("" + THE_BUTTON_OPTION);
    JPanel radioPanel = new JPanel(new GridLayout(0, 1));
    radioPanel.add(newLabel);
    radioPanel.add(theStandardButton1);
    radioPanel.add(theTimeButton);
    radioPanel.add(theTypeButton);
    radioPanel.add(theExtButton);
    radioPanel.add(theButton);
    add(radioPanel, BorderLayout.LINE_START);      
         public void actionPerformed (ActionEvent e) {
         if(e.getSource() == theButton)
         JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("The Font");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    TableFonts newFont = new TableFonts();
    newFont.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newFont);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
         selectedOption = Integer.parseInt(e.getActionCommand().trim());
         public Formats getInstance(){
              return this;      
    and the last class:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TableFonts extends JPanel implements ActionListener{
         static String standardFont = "Standard Font";
         static String boldFont = "Bold Font";
         static String italicFont = "Italic Font";
         static String monospaceFont = "Monospace Font";
         public      JRadioButton theStandardButton ;
         public JRadioButton theBoldButton;
         public JRadioButton theItalicButton;
         public JRadioButton theMonospaceButton ;
         public TableFonts()
    theStandardButton = new JRadioButton(standardFont);
         theStandardButton.setMnemonic(KeyEvent.VK_B);     
    theStandardButton.setSelected(true);
         theBoldButton = new JRadioButton(boldFont);
         theBoldButton.setMnemonic(KeyEvent.VK_B);     
    theItalicButton = new JRadioButton(italicFont);
         theItalicButton .setMnemonic(KeyEvent.VK_B);     
    theMonospaceButton = new JRadioButton(monospaceFont);
         theMonospaceButton.setMnemonic(KeyEvent.VK_B);     
         ButtonGroup group = new ButtonGroup();
    group.add(theStandardButton);
    group.add(theBoldButton);
    group.add(theItalicButton);
    group.add(theMonospaceButton);
    theStandardButton.addActionListener(this);
    theBoldButton.addActionListener(this);
    theItalicButton.addActionListener(this);
    theMonospaceButton.addActionListener(this);
    JLabel newLabel = new JLabel("Choose the correct font for the data to be displayed");
    JPanel radioPanel = new JPanel(new GridLayout(0, 1));
    radioPanel.add(newLabel);
    radioPanel.add(theStandardButton);
    radioPanel.add(theBoldButton);
    radioPanel.add(theItalicButton);
    radioPanel.add(theMonospaceButton);
    add(radioPanel, BorderLayout.LINE_START);
         public void actionPerformed(ActionEvent e) {
    The problem I am getting is the Number format exception when the OK button of the class Formats is clicked...
    here is the error I am getting:
    java.lang.NumberFormatException: For input string: "OK"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.
    java:48)
    at java.lang.Integer.parseInt(Integer.java:426)
    at java.lang.Integer.parseInt(Integer.java:476)
    at Formats.actionPerformed(Formats.java:80)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
    64)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
    ctButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5134)
    at java.awt.Component.processEvent(Component.java:4931)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3639)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1590)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    COULD YOU GUYS PLEASE TELL ME HOW TO GET AROUND THIS PROBLEM:
    THANKS...

    It's in this line:
    selectedOption = Integer.parseInt(e.getActionCommand().trim());
    Kind regards,
      Levi
    PS. have you noticed the [code][code[i]] tags?

  • Oracle Workflow for Java (OW4J) Preview Available!

    Oracle® Workflow for Java (OW4J) delivers a java based business process management system that supports business process definition, business process automation, and business process integration. The technology enables modeling, automation, and continuous improvement of business processes, routing information of any type according to user-defined business rules. Oracle Workflow for Java supports fast, non-persistent, straight-through processes which run only in memory. It does not require a database, but does support persistent, long-running business processes with a complete audit trail stored in a database. OW4J will also include the Worklist and email notification and response capabilities which are essential to business process automation activities.
    Oracle Workflow for Java provides the users with all the components required to build and deploy a business processes using J2EE technology.
    * Oracle Workflow for Java Engine: OW4J is based on open standards and is a high-performance, scalable workflow engine capable of executing Java classes, Enterprise JavaBeans (EJBs), and Web services, sending and receiving Java Message Services (JMS) messages and e-mails, and launching workflows from message-driven beans.
    * Oracle JDeveloper Workflow Modeler: Oracle JDeveloper Workflow Modeler is a Business Process Modeling tool used to build and deploy business processes using Oracle JDeveloper IDE. It provides the user with an easy-to-use, intuitive drag-and-drop tool for modeling business processes.
    OW4J Developer Preview
    Download the developer preview and start building and running business processes using the new JDeveloper Workflow Modeler. Out-of-the-box Runnable Demo including stock quote web service demo (does not require database) and Procurement Demo which demonstartes the range of capabilities of OW4J by including various technologies like EJB, Web Services, PL/SQL and Java Classes into a business processes without any coding.
    Please post your feedback and questions using the Forum. It is valuable to us!
    Cheers,
    Raja

    Raja,
    We're having some difficulty getting the StockQuote demo working with the latest OW4J Preview release. We get the demo web page to appear but are not sure how to set Owner, ItemKey, and UserKey such that we don't get the following errors when we click "Run Workflow". Any help would be appreciated.
    Cheers,
    tim
    Error output in JDev 9.0.5.2 after clicking "Run Workflow" with or without entering values for above entries:
    Handle.Fault[oracle.apps.fnd.wf.engine.ExecutionException] at C:/jdev9052/jdev/mywork/OW4JDemos/StockQuote/src./ow4j/demo/stockquote.StockQuote[1086617569608]
    Caused By: executeRPC[C:/jdev9052/jdev/mywork/OW4JDemos/StockQuote/src./ow4j/demo/stockquote.StockQuote[1086617569608].processActivity1[1086617569610]] at $Header: AbstractExecutor.java 30.0 2003/03/25 22:43:21 anpwang noship $
    Caused By: 04/06/07 10:13:10 [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content type &quot;text/html&quot;, must be: &quot;text/xml&quot;. Response was:
    &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
    &lt;HTML dir=ltr&gt;&lt;HEAD&gt;&lt;TITLE&gt;The page cannot be displayed&lt;/TITLE&gt;
    &lt;STYLE&gt;A:link {
         FONT: 8pt/11pt verdana; COLOR: #ff0000
    A:visited {
         FONT: 8pt/11pt verdana; COLOR: #4e4e4e
    &lt;/STYLE&gt;
    &lt;META content=NOINDEX name=ROBOTS&gt;
    &lt;META http-equiv=Content-Type content=&quot;text-html; charset=Windows-1252&quot;&gt;
    &lt;META content=&quot;MSHTML 5.50.4522.1800&quot; name=GENERATOR&gt;&lt;/HEAD&gt;
    &lt;BODY bgColor=#ffffff&gt;
    &lt;TABLE cellSpacing=5 cellPadding=3 width=410&gt;
    &lt;TBODY&gt;
    &lt;TR&gt;
    &lt;TD vAlign=center align=left width=360&gt;
    &lt;H1 style=&quot;FONT: 13pt/15pt verdana; COLOR: #000000&quot;&gt;&lt;!--Problem--&gt;The page
    cannot be displayed&lt;/H1&gt;&lt;/TD&gt;&lt;/TR&gt;
    &lt;TR&gt;
    &lt;TD width=400 colSpan=2&gt;&lt;FONT
    style=&quot;FONT: 8pt/11pt verdana; COLOR: #000000&quot;&gt;There is a problem with the
    page you are trying to reach and it cannot be displayed.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
    &lt;TR&gt;
    &lt;TD width=400 colSpan=2&gt;&lt;FONT
    style=&quot;FONT: 8pt/11pt verdana; COLOR: #000000&quot;&gt;
    &lt;HR color=#c0c0c0 noShade&gt;
    &lt;P&gt;Please try the following:&lt;/P&gt;
    &lt;UL&gt;
    &lt;LI&gt;Click the Refresh button,
    or try again later.&lt;BR&gt;
    &lt;LI&gt;Open the Web site
    home page, and then look for links to the information you want.&lt;/LI&gt;
    &lt;LI&gt;If you believe you should be able to view this directory or page,
    please contact the Web site administrator by using the e-mail address or
    phone number listed on the Web site
    home page. &lt;/LI&gt;&lt;/UL&gt;
    &lt;H2 style=&quot;FONT: 8pt/11pt verdana; COLOR: #000000&quot;&gt;10060 - Connection timeout&lt;BR&gt;Internet Security and Acceleration Server&lt;/H2&gt;
    &lt;HR color=#c0c0c0 noShade&gt;
    &lt;P&gt;Technical Information (for support personnel)&lt;/P&gt;
    &lt;UL&gt;
    &lt;LI&gt;Background:&lt;BR&gt;The gateway could not receive a timely response from the Web site you are trying to access. This might indicate that the network is congested, or that the Web site is experiencing technical difficulties.&lt;P&gt;&lt;/P&gt;&lt;/LI&gt;
    &lt;LI&gt;ISA Server: ns.mgbltd.com&lt;BR&gt;
    Via: &lt;BR&gt;&lt;BR&gt;Time: 6/7/2004 2:13:10 PM GMT
    &lt;/LI&gt;&lt;/UL&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;
    04/06/07 10:13:10      at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:209)
    04/06/07 10:13:10      at org.apache.soap.rpc.Call.invoke(Call.java:268)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.executor.OracleSoapExecutor.executRPC(OracleSoapExecutor.java:179)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.executor.OracleSoapExecutor.execute(OracleSoapExecutor.java:115)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.executeActivityInternal(JavaEngine.java:1088)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.executeActivity(JavaEngine.java:709)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.processStack(JavaEngine.java:841)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.doStartProcess(JavaEngine.java:979)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.startFlow(JavaEngine.java:171)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.WorkItemProcess.startFlow(WorkItemProcess.java:132)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.runner.RequestHelper.processRequest(RequestHelper.java:105)
    04/06/07 10:13:10      at WFProcessDetails.jspService(WFProcessDetails.jsp:232)
    04/06/07 10:13:10      at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:57)
    04/06/07 10:13:10      at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
    04/06/07 10:13:10      at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    04/06/07 10:13:10      at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    04/06/07 10:13:10      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    04/06/07 10:13:10      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    04/06/07 10:13:10      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    04/06/07 10:13:10      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:604)
    04/06/07 10:13:10      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
    04/06/07 10:13:10      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    04/06/07 10:13:10      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    04/06/07 10:13:10      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    04/06/07 10:13:10      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    04/06/07 10:13:10      at java.lang.Thread.run(Thread.java:534)
    executeRPC[C:/jdev9052/jdev/mywork/OW4JDemos/StockQuote/src./ow4j/demo/stockquote.StockQuote[1086617569608].processActivity1[1086617569610]] at $Header: AbstractExecutor.java 30.0 2003/03/25 22:43:21 anpwang noship $
    Caused By: 04/06/07 10:13:10 [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content type &quot;text/html&quot;, must be: &quot;text/xml&quot;. Response was:
    &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
    &lt;HTML dir=ltr&gt;&lt;HEAD&gt;&lt;TITLE&gt;The page cannot be displayed&lt;/TITLE&gt;
    &lt;STYLE&gt;A:link {
         FONT: 8pt/11pt verdana; COLOR: #ff0000
    A:visited {
         FONT: 8pt/11pt verdana; COLOR: #4e4e4e
    &lt;/STYLE&gt;
    &lt;META content=NOINDEX name=ROBOTS&gt;
    &lt;META http-equiv=Content-Type content=&quot;text-html; charset=Windows-1252&quot;&gt;
    &lt;META content=&quot;MSHTML 5.50.4522.1800&quot; name=GENERATOR&gt;&lt;/HEAD&gt;
    &lt;BODY bgColor=#ffffff&gt;
    &lt;TABLE cellSpacing=5 cellPadding=3 width=410&gt;
    &lt;TBODY&gt;
    &lt;TR&gt;
    &lt;TD vAlign=center align=left width=360&gt;
    &lt;H1 style=&quot;FONT: 13pt/15pt verdana; COLOR: #000000&quot;&gt;&lt;!--Problem--&gt;The page
    cannot be displayed&lt;/H1&gt;&lt;/TD&gt;&lt;/TR&gt;
    &lt;TR&gt;
    &lt;TD width=400 colSpan=2&gt;&lt;FONT
    style=&quot;FONT: 8pt/11pt verdana; COLOR: #000000&quot;&gt;There is a problem with the
    page you are trying to reach and it cannot be displayed.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
    &lt;TR&gt;
    &lt;TD width=400 colSpan=2&gt;&lt;FONT
    style=&quot;FONT: 8pt/11pt verdana; COLOR: #000000&quot;&gt;
    &lt;HR color=#c0c0c0 noShade&gt;
    &lt;P&gt;Please try the following:&lt;/P&gt;
    &lt;UL&gt;
    &lt;LI&gt;Click the Refresh button,
    or try again later.&lt;BR&gt;
    &lt;LI&gt;Open the Web site
    home page, and then look for links to the information you want.&lt;/LI&gt;
    &lt;LI&gt;If you believe you should be able to view this directory or page,
    please contact the Web site administrator by using the e-mail address or
    phone number listed on the Web site
    home page. &lt;/LI&gt;&lt;/UL&gt;
    &lt;H2 style=&quot;FONT: 8pt/11pt verdana; COLOR: #000000&quot;&gt;10060 - Connection timeout&lt;BR&gt;Internet Security and Acceleration Server&lt;/H2&gt;
    &lt;HR color=#c0c0c0 noShade&gt;
    &lt;P&gt;Technical Information (for support personnel)&lt;/P&gt;
    &lt;UL&gt;
    &lt;LI&gt;Background:&lt;BR&gt;The gateway could not receive a timely response from the Web site you are trying to access. This might indicate that the network is congested, or that the Web site is experiencing technical difficulties.&lt;P&gt;&lt;/P&gt;&lt;/LI&gt;
    &lt;LI&gt;ISA Server: ns.mgbltd.com&lt;BR&gt;
    Via: &lt;BR&gt;&lt;BR&gt;Time: 6/7/2004 2:13:10 PM GMT
    &lt;/LI&gt;&lt;/UL&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;
    04/06/07 10:13:10      at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:209)
    04/06/07 10:13:10      at org.apache.soap.rpc.Call.invoke(Call.java:268)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.executor.OracleSoapExecutor.executRPC(OracleSoapExecutor.java:179)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.executor.OracleSoapExecutor.execute(OracleSoapExecutor.java:115)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.executeActivityInternal(JavaEngine.java:1088)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.executeActivity(JavaEngine.java:709)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.processStack(JavaEngine.java:841)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.doStartProcess(JavaEngine.java:979)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.impl.JavaEngine.startFlow(JavaEngine.java:171)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.engine.WorkItemProcess.startFlow(WorkItemProcess.java:132)
    04/06/07 10:13:10      at oracle.apps.fnd.wf.runner.RequestHelper.processRequest(RequestHelper.java:105)
    04/06/07 10:13:10      at WFProcessDetails.jspService(WFProcessDetails.jsp:232)
    04/06/07 10:13:10      at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:57)
    04/06/07 10:13:10      at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
    04/06/07 10:13:10      at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    04/06/07 10:13:10      at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    04/06/07 10:13:10      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    04/06/07 10:13:10      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    04/06/07 10:13:10      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    04/06/07 10:13:10      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:604)
    04/06/07 10:13:10      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
    04/06/07 10:13:10      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    04/06/07 10:13:10      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    04/06/07 10:13:10      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    04/06/07 10:13:10      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    04/06/07 10:13:10      at java.lang.Thread.run(Thread.java:534)

  • Displaying Windows True Type fonts using Java 1.1.x

    Can anyone shed some light on why I cant just use the name of the fon't I want to display? Here is the code I'm using:
    Font font1 = new Font(sFontName, iStyle, iSize);
    this.setFont(font1);
    sFontName is the name of the font, and it works with the font names that are garaunteed by Java (i.e. Dialog, DialogInput, Monospaced, Serif, SansSerif, or Symbol), but if I try to use a true type font name such as "Tahoma" it just loads the default font instead. Is there a different method required to load system dependant fonts?
    Any ideas would be greatly appreciated. Thanks.

    If your font is properly installed (i.e. in the fonts folder and you've performed a restart) then it should work. I have code in the splash screen for an open source project like this:
    subTitleLbl.setFont (new java.awt.Font ("Lucida Blackletter", 0, 18));Which works if the font is properly installed. Otherwise, it simply grabs the system font, as you indicated.
    I've done some searching, and haven't found a way to load a font into java. Java won't do it because it's not platform independent.
    Fortunately, this code works even if the font is not present--it just won't have the font you want.

  • Fonts in Windows and Fonts in Java

    Hello,
    Say I have in my app:
    String string = "\\u09A1";
    I want to display this in my app. I can call:
    GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    I can then iterate through these and find out which ones can display this unicode character using,
    font.canDisplayUpTo(string);
    My question is, are these the fonts that Java can display (from charsets.jar) or the ones installed in Windows?
    I would like to be able to get lists for both of these.
    Any ideas?
    Cheers,
    Jim

    Thank you. I did read that. I was not talking about drawing text in 'Hello World' alike applets/programs.
    I should give an example:
    I would like to print 'H' in Tahoma, 72, Bold (Windows format) at (100, 200).
    Font sizes:
    In Windows font size is 72 pixels.
    In Java this is equal to 96 points (72 px * 96 (scr resolution for Toolkit) / 72 (pixels per point).
    Real height in Windows and Java will be 64 px.
    That's fine. For some fonts this does not work.
    Positioning. See example above.
    According to the article you refer to in java we should use y-coordinate 200 + 72 (font size) = 272.
    In fact we have :
    Java text 14 pixels below than expected.
    Similar things happen to other parameters Weight, Styles, etc.
    I do use AttributedString and TextAttribute classes to render text
    Thanks in advance.
    Alex

Maybe you are looking for

  • The new version of Firefox won't let me access the internet. How do I fix that? I hate Internet Explorer!

    On Saturday, 5/10/14, I was using Firefox at work with zero issues. I attended to work briefly, and when I looked back I saw the status bar saying my "add-ons" were being checked. Ever since then, Firefox WILL NOT connect to the internet, and I am fo

  • Too Much Inactive Memory Useage

    Hi, I have a 2010 iMac running Mac OS X version 10.7.5. I have upgraded to 16GB Ram but still have serious issues with the computer running slow sometimes are almost stopping because the memory usage seems to be too high. I run quiet a few applicatio

  • Assignment of service master & component

    Hi PM experts, Would anyone please clear my following doubts---- 1. whether service master can be assigned to any internal operation or any sub-operation? 2.Whether any components can be assigned to any sub-operation? 3.whether screen template for ov

  • Why are transparent Keynote objects visible in playback?

    I often want an object to rotate around one end rather than about the center. My workaround is to duplicate the object in question, flip it around both axes and attach it to the end of the object that I want to be the axis of rotation. At this point,

  • Newbie question-converting dv to watch on dvd player

    Merry Christmas all! Im trying to transfer some old analog video. doing this with canon elura 100 camcorder. transfering to iMovie. Im not sure if this is the best way. All I want to do with this video is throw it on a dvd to play on a dvd player con