Fonts in Applet

I'm running applet with plug-in, so I want to set one font for all components in applet. I can specified font for everyone of them, but ...
Is there possibility to be done.

look at the UIManager Class - this sets the default look and feel - just change this and reapply to all your controls
see:http://java.sun.com/j2se/1.4/docs/api/javax/swing/UIManager.html

Similar Messages

  • How change o.s. font from applet ?????

    In the properties of desktop there is a possibility to change font System : small font and large font - 96 dpi and 120 dpi.
    When the large font is setted the labels in my applet became broken .
    How i can change this font from applet ??
    I have already seen the System.properties class but there isn't font key
    please if you know i have a big urgent.
    thank you

    In the properties of desktop there is a possibility to
    change font System : small font and large font - 96
    dpi and 120 dpi.
    When the large font is setted the labels in my applet
    became broken .
    How i can change this font from applet ??
    I have already seen the System.properties class but
    there isn't font keyYou can't change the system font from your applet, you can use fixed fonts in your applet though.
    please if you know i have a big urgent.LOLOLOLOLOL, sorry, couldn't help it, nothing personal, but just that sentence.
    thank youCheers.
    p.s. 1 hint;
    nobody cares if you're in a hurry or not, we're all busy people, mentioning it mostly tick people off, causing them not to respond or respond later.

  • Embedding fonts into applets

    hi im making a applet game and it has a custom font
    how can i embed the font so the user does not have to install it manually
    i read on page u can do this by adding it to the jar and pointing to it some how but they dint explain how
    is this possible or is there another way ? point to the font if i upload it or soming
    thx :)

    been playin with this for past few hours not getting any were just dont no java well enough to really understand whats going on
    all going over my head
    font is at http://www.auba18.dsl.pipex.com/fruitsim/AthleticTown.ttf
    my applet class files r at
    http://www.auba18.dsl.pipex.com/fruitsim/
    so same place as my font
    i just need the applet to some how load this font and display it were the other ones are grabbing "LCD"
    iv got a few pieces of code no idea which one to use or how to get them to compile properlty
    would some one be able to add the code in for me would really appreciate it thanks :)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.applet.*;
    import java.io.*;
    import java.io.InputStream;
    import java.net.URL;
    public class drawTopbox {
         private Applet parrentapp;
         JLabel imageLabel;
         ImageIcon ImageIcon;
         JLabel bronze = new JLabel("000.00");
         JLabel silver = new JLabel("000.00");
         JLabel gold = new JLabel("000.00");
         //InputStream in = getClass().getResourceAsStream("AthleticTown.ttf");
         //public static Font createFont(int in);
         //Font     font = Font.createFont(Font.TRUETYPE_FONT, in);
         //InputStream fis = new FileInputStream("font.ttf");
         //Font f = Font.createFont(Font.TRUETYPE_FONT, fis);
         public drawTopbox(Applet parrent, int maxSlots) {
              parrentapp = parrent;          
         try {
         URL url = new URL("AthleticTown.ttf");
         InputStream is = url.openStream();
         Font font = Font.createFont(Font.TRUETYPE_FONT, is);
          } catch (Exception e) {
          e.printStackTrace();
              // bronze
              bronze.setBounds(((187*maxSlots)/2)-99, 14 ,100, 50); 
              bronze.setFont(new Font(font, Font.PLAIN, 25));
              bronze.setForeground(Color.red);
              parrentapp.add(bronze);
              // silver
              silver.setBounds(((187*maxSlots)/2)-54, 45 ,100, 50); 
              silver.setFont(new Font("LCD", Font.PLAIN, 25));
              silver.setForeground(Color.red);
              parrentapp.add(silver);
              // gold
              gold.setBounds(((187*maxSlots)/2)-20, 9 ,200, 50); 
              gold.setFont(new Font("LCD", Font.PLAIN, 35));
              gold.setForeground(Color.red);
              parrentapp.add(gold);
              // background
              ImageIcon = new ImageIcon(parrentapp.getImage(parrentapp.getCodeBase(), "Images/topbox.gif"));
              imageLabel = new JLabel(ImageIcon);
              imageLabel.setBounds(((187*maxSlots)/2)-135, 0, 271, 100);
              parrentapp.add(imageLabel);
              parrentapp.setLayout(null);
         *     displayBronze                              *
         public void displayBronze(double value) {
              bronze.setText(String.valueOf(value) + "0");     
         *     displaySilver                              *
         public void displaySilver(double value) {
              silver.setText(String.valueOf(value) + "0");     
         *     displayGold                                   *
         public void displayGold(double value) {
              gold.setText(String.valueOf(value) + "0");     
         *     clearValue                                   *
         public void clearValue(int value) {
              switch (value) {
             case 0:
                        gold.setText("");     
                        break;
               case 1:
                        silver.setText("");     
                        break;
               case 2:
                        bronze.setText("");     
                        break;
    }silver and gold work fine (old way grabbing from pc)
    trying to convert bronze to work by grabbing font from my server

  • Smudged Bold font in applet

    I have written an applet which displays messages like they are being typed on screen . I am creating an offscreen image which displays the text of the message.
    My problem is that when i display the message using any font in BOLD the text smudges in the applet.I tried to run the applet on different machines,On some machines it works fine and it gets smudged on others.
    The code is as follows:
    public void typemsg()
         try
    boolean flag = false;
    int i = canvas.height - (m_yoffset + fm.getDescent());
    g_off.setColor(m_bgcolor);
    g_off.fillRect(0, 0, d.width, d.height);//sets bkground
    g_off.setColor(m_textcolor);
    for(cur_msg_num = 0; cur_msg_num < num_descrips; cur_msg_num++)//messges are read frm a file and stored in an array
    int j;
    if(m_centertext)
    j = (canvas.width - fm.stringWidth(m_cur_desc[cur_msg_num])) / 2;// for center aligning
    else
    j = m_xoffset;
    for(int k = 0; k < m_cur_desc[cur_msg_num].length(); k++)
    if(k == m_cur_desc[cur_msg_num].length() - 1)
    g_off.drawString(m_cur_desc[cur_msg_num].substring(0), j, i);
    else
    g_off.drawString(m_cur_desc[cur_msg_num].substring(0, k), j, i);
    try
    Thread.sleep(m_speed);//delay for typing effect
    catch(InterruptedException _ex) { }
    getGraphics().drawImage(off, 0, 0, this);
    try
    Thread.sleep(m_delay);// delay before the msg gets scrolled upwards
    catch(InterruptedException _ex) { }
    //following code scrolls the message out of screen from top
    if(m_scrollit && m_scroll_jump > 0)
    while(pos >= -d.height)
    pos = pos - m_scroll_jump;
    getGraphics().drawImage(off, 0, pos, this);
    getGraphics().drawImage(erase, 0, pos + d.height, this);
    try
    Thread.sleep(m_scroll_delay);
    catch(InterruptedException _ex) { }
    pos = 0;
    g_off.setColor(m_bgcolor);
    g_off.fillRect(0, 0, d.width, d.height);
    g_off.setColor(m_textcolor);
         }catch(Exception ex)
    Any help is welcome. Excuse my english.Thanx in advance

    I think you'll not find the solution in your code, smudge fonts are usually a software/hardware problem. Check the drivers on the machines that work against those that don't work and you'll see a different versions or possibly differenct hardware entirely. Get an upgrade for the ones that don't work properly.
    And yes I know it is a pain to upgrade clients--I've had to do 600 or more at a time to get things to work properly before, but if it has to be done, then it has to be done.

  • Tamil font in Applet

    I want to set Tamil font "Tab-Anna" for the checkbox in Applet program.(in INIT method).
    If anybody knows to set tamil font,please help me.

    Hi
    You can try using Font.createFont( int fontFormat, InputStream fontStream)
    but if ur font is .TTF file then u may get desirable result but if ur font is .TTC type
    then can't say.
    U can keep ur .TTF/.TTC file in jar file of ur applet and from Class.getResourceAsStream u can get its inputstream
    But if u can't use inputstream in applet, try installing that font on ur system and try using methods of class GraphicsEnviornment.
    GraphicsEnvironment getLocalGraphicsEnvironment() will return u GraphicsEnvironment of ur system and then try getAllFonts() or getAvailableFontFamilyNames().
    Just give it a try.. if that works out please let me know..
    Regards
    Shailesh
    Regards
    Shailesh

  • External font in an applet

    How can I use a non windows font in my applet? Its a ttf font.
    The font file, applet class file and the htm file have to be in the same directory on my webserver.

    Yeah, thats what i would like to know too:) i know this post is 2 years old, but i hope someone will notice it :)

  • How to set "global" font?

    Where must I change font type and / or style to take effect in whole applet? I do not want to do that for every item separately. If I set font for applet it does not effect in panels and other elements.
    I am using Netbeans 5.5, Java 1.5.

    Here's how I do it.
       * Overrides all the font settings from the LookAndFeel.  The default fonts
       * tend to be too small and to render poorly on an LCD monitor, even with
       * anti-aliasing.  This should be done before any GUI components are created.
      public static void fixFonts()
        // These components will use the user-specified monospaced font
        String[] monoFonts = {
          "ComboBox.font",
          "OptionPane.messageFont",
          "Spinner.font",
          "TextField.font",
          "FormattedTextField.font",
          "PasswordField.font",
          "TextArea.font"
        // Replace all these with the user-specified sans-serif font
        String[] sansFonts = {
          "Button.font",
          "ToggleButton.font",
          "RadioButton.font",
          "CheckBox.font",
          "ColorChooser.font",
          "Label.font",
          "List.font",
          "MenuBar.font",
          "MenuItem.font",
          "RadioButtonMenuItem.font",
          "CheckBoxMenuItem.font",
          "Menu.font",
          "PopupMenu.font",
          "OptionPane.font",
          "OptionPane.buttonFont",
          "Panel.font",
          "ProgressBar.font",
          "ScrollPane.font",
          "Viewport.font",
          "Slider.font",
          "TabbedPane.font",
          "Table.font",
          "TableHeader.font",
          "TitledBorder.font",
          "ToolBar.font",
          "ToolTip.font",
          "Tree.font"
        // These components will use the user-specified serif font
        String[] smallerFonts = {
          "Menu.acceleratorFont",
          "MenuItem.acceleratorFont",
          "RadioButtonMenuItem.acceleratorFont",
          "CheckBoxMenuItem.acceleratorFont"
        // These components will use the user-specified serif font
        String[] serifFonts = {
          "TextPane.font",
          "EditorPane.font"
        // These components will use the user-specified bold font
        String[] boldFonts = {
          "InternalFrame.titleFont"
        Font sansFont    = new Font("Bitstream Vera Sans",      Font.PLAIN, 12);
        Font smallerFont = new Font("Bitstream Vera Sans",      Font.PLAIN, 11);
        Font monoFont    = new Font("DejaVu Sans Mono",         Font.PLAIN, 14);
        Font boldFont    = new Font("Bitstream Vera Sans Bold", Font.PLAIN, 12);
        Font serifFont   = new Font("Bitstream Vera Serif",     Font.PLAIN, 12);
        UIDefaults defs = UIManager.getDefaults();
        for (String key : sansFonts)
          defs.put(key, sansFont);
        for (String key : smallerFonts)
          defs.put(key, smallerFont);
        for (String key : monoFonts)
          defs.put(key, monoFont);
        for (String key : boldFonts)
          defs.put(key, boldFont);
        for (String key : serifFonts)
          defs.put(key, serifFont);
        // Some L&F's use a hard-coded height for tree cells based on a 12-point
        // font.  Setting it to zero lets the cell renderer determine the height.
        if (sansFont.getSize() != 12)
          defs.put("Tree.rowHeight", 0);
        // Get rid of the bold fonts when using a Metal L&F.
        defs.put("swing.boldMetal", Boolean.FALSE);
      }

  • Help!!! Need Java Applet to work in IE

    I found some applets (text scrollers) from the sun site that i wanted to use. downloaded them, but they do not work in IE that does not have JVM. in IE that does have JVM it says 'Java 1.1 Required' where the applet should be. is there a simple way to get sun java applets to work with IE and the MS Virtual Machine? I can't require my site visitors to have to download extra toys/plugins...

    If you are looking for a purely AWT scrolling applet. Here is one I wrote several years ago. Please note that there are some deprecated methods in it (mainly the thread start and stop methods). It will still compile though. If you want it, take it.
    Source:import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.net.*;
    public class ScrollApplet extends Applet implements Runnable
       /*=*********************
       * private data members *
       private Thread myThread = null;
       private boolean hasTextDisplayed;
       private int appletWidth, appletHeight;
       private int yPosition;
       private int xPosition;
       private Image textImage;
       private int imageWidth;
       private Graphics textGraphics;
       private Cursor oldCursor;
       private Cursor newCursor = new Cursor(Cursor.HAND_CURSOR);
       //parameters
       private int delay;
       private String displayText;
       private Color bgColor, fgColor;
       private int fontSize, fontStyle;
       private Font fontType;
       private String urlValue;
       /*=***************
       * applet methods *
       public void init()
          //assign values to private data members
          hasTextDisplayed = false;
          appletHeight = yPosition = getSize().height;
          appletWidth = xPosition = getSize().width;
          //set up the environment
          extractParameters();
          //determine the yPosition to place the image
          calculateYPosition();
          //set up the text image
          FontMetrics fm = getFontMetrics(fontType);
          imageWidth = fm.stringWidth(displayText);
          textImage = createImage(imageWidth, appletHeight);
          textGraphics = textImage.getGraphics();
          textGraphics.setColor(bgColor);
          textGraphics.fillRect(0,0,imageWidth,appletHeight);
          textGraphics.setColor(fgColor);
          textGraphics.setFont(fontType);
          textGraphics.drawString(displayText, 0, yPosition);
          oldCursor = this.getCursor();
          addMouseListener(new MouseAdapter() {
             public void mouseExited(MouseEvent e)
                if (urlValue != null) {
                   Component thisApplet = e.getComponent();
                   thisApplet.setCursor(oldCursor);
                showStatus(" ");
                myThread.resume();
             public void mouseEntered(MouseEvent e)
                myThread.suspend();
                if (urlValue != null) {
                   Component thisApplet = e.getComponent();
                   thisApplet.setCursor(newCursor);
                   showStatus(urlValue);
                else
                   showStatus("paused");
             public void mouseClicked(MouseEvent e)
                if (urlValue != null)
                   try {
                      URL u = new URL(urlValue);
                      getAppletContext().showDocument(u, "_self");
                   } catch(MalformedURLException ex) {
                   showStatus("MalformedURLException: " +ex);
       }//end init method
       public void start()
          myThread = new Thread(this);
          myThread.start();
       }//end start method
       public void update(Graphics g)
       //overwrote this method to avoid repainting of background before all text displays
          if (hasTextDisplayed == true)
             //repaint the background
             g.setColor(bgColor);
             g.fillRect(xPosition+imageWidth, 0, appletWidth - (xPosition + imageWidth),
                          appletHeight);
             g.setColor(fgColor);
          paint(g);
       }//end update method
       public void paint(Graphics g)
          setBackground(bgColor);
          g.drawImage(textImage,xPosition,0,this);
       }//end paint method
       public void stop()
       { myThread = null; }
       /*=*******************************************************************************
       * applet method getParameterInfo():                                              *
       * Returns information about the parameters that are understood by this applet.   *
       * An applet should override this method to return an array of Strings describing *
       * these parameters.  Each element of the array should be a set of three Strings  *
       * containing the name, the type, and a description.                              *
       public String[][] getParameterInfo()
          String parameterInfo[][] = {
             {"DELAYPARAM", "int", "The interval to pause in milliseconds"},
             {"TEXTPARAM", "string", "The text that will be displayed"},
             {"BGPARAM", "Color", "The bg color for the applet, in html format #FFFFFF"},
             {"FGPARAM", "Color", "The fg color for the text, in html format #FFFFFF"},
             {"FONTSIZEPARAM", "int", "The font size of the text"},
             {"FONTTYPEPARAM", "string", "The name of the font to use"},
             {"FONTSTYLEPARAM", "string", "bold, italic, or bold+italic"},
             {"URLPARAM", "string", "hyperlink"}
          return parameterInfo;
       }//end getParameterInfo method
       /*=*****************************************************************************
       * applet method getAppletInfo():                                               *
       * Returns information about this applet. An applet should override this method *
       * to return a String containing information about the author, version, and     *
       * copyright of the applet.                                                     *
       public String getAppletInfo()
          String infoAboutMe;
          infoAboutMe = new String(
             "Author:  Your Name Here/n" +
             "Description:  My first text scroller\n" +
             "Version: 1.0"
          return infoAboutMe;
       }//end getAppletInfo method
       /*=***************
       * thread methods *
       public void run()
          Thread current = Thread.currentThread();
          //loop until thread is stopped
          while (myThread == current)
             repaint();
             try {
                current.sleep(delay);
                xPosition--;
             } catch (InterruptedException e) {}
             if (xPosition <= (appletWidth - imageWidth))
                hasTextDisplayed = true;
             else
                hasTextDisplayed = false;
             if (xPosition == (0 - imageWidth))
                xPosition = appletWidth;
       }//end required run method
       /*=**********************************************************************
       * extractParameters():  Sets all parameter values, if any were provided *
       public void extractParameters()
          String delayValue = getParameter("DELAYPARAM");
          String textValue = getParameter("TEXTPARAM");
          String bgColorValue = getParameter("BGPARAM");
          String fgColorValue = getParameter("FGPARAM");
          String fontSizeValue = getParameter("FONTSIZEPARAM");
          String fontTypeValue = getParameter("FONTTYPEPARAM");
          String fontStyleValue = getParameter("FONTSTYLEPARAM");
          String urlParam = getParameter("URLPARAM");
          //set delay to one tenth of a second if missing parameter
          delay = ((delayValue == null) ? 100 : Integer.parseInt(delayValue));
          urlValue = (urlParam == null ? null : urlParam);
          displayText = ((textValue == null) ?
                new String("NO TEXT WAS PROVIDED!") :
                textValue);
          bgColor = determineColor(bgColorValue);
          fgColor = determineColor(fgColorValue);
          fontStyle = determineFontStyle(fontStyleValue);
          fontSize = ((fontSizeValue == null) ? 12 : Integer.parseInt(fontSizeValue));
          fontType = new Font(fontTypeValue, fontStyle, fontSize);
       }//end extractParameters method
       /*=*************************************************
       * determineColor():  returns the appropriate color *
       public Color determineColor(String value)
          return parseHTMLHex(value);
       }//end determineColor method
       /*=*****************************************************************************
       * parseHTMLHex(): parses an HTML hex (eg #FFFFFF) and returns the Color object *
       public static Color parseHTMLHex(String htmlHex) {
          Color color = new Color(220,220,220);  //default grey
          if (htmlHex != null) {
             String red = htmlHex.substring(1,3);
             String green = htmlHex.substring(3,5);
             String blue = htmlHex.substring(5);
             color = new Color(Integer.parseInt(red,16),
                           Integer.parseInt(green,16),
                           Integer.parseInt(blue,16));
          }//end if
          return color;
       }//end parseHTMLHex method
       /*=******************************************
       * determineFontStyle():  returns font sytle *
       public int determineFontStyle(String value)
          int returnVal;
          if (value == null)
             returnVal = Font.PLAIN;
          else if (value.equalsIgnoreCase("plain"))
             returnVal = Font.PLAIN;
          else if (value.equalsIgnoreCase("bold"))
             returnVal = Font.BOLD;
          else if (value.equalsIgnoreCase("italic"))
             returnVal = Font.ITALIC;
          else if (value.equalsIgnoreCase("bold+italic"))
             returnVal = Font.BOLD + Font.ITALIC;
          else
             returnVal = Font.PLAIN;
          return returnVal;
       }//end determineFontStyle method
       /*=**********************************************************
       * calculateYPosition(): want text to be in middle of applet *
       public void calculateYPosition()
          //wasYPositionCalculated = true;
          //make calculations to center font in applet window
          int appletMidHeight = appletHeight / 2;         //the middle of the applet
          FontMetrics fm = getFontMetrics(fontType);    //font metrics for current font
          int fontMidHeight = fm.getAscent() / 2;         //the middle of the font
          int currentFontSizeValue;                       //temp value for font size
          //if the font size if too big, fix it
          if ((currentFontSizeValue = fm.getAscent()) > appletHeight)
             //cycle through font sizes until find one that fits
             while (currentFontSizeValue > appletHeight)
                fontType = new Font(getParameter("FONTTYPEPARAM"), fontStyle, --fontSize);
                fm = getFontMetrics(fontType);
                currentFontSizeValue = fm.getAscent();
             //set the new values for the new font
             setFont(fontType);
             fm = getFontMetrics(fontType);
             fontMidHeight = fm.getAscent() / 2;
          yPosition = appletMidHeight + fontMidHeight - 3;
       }//end calculateYPosition()
    }//end applethtml:<HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>Test scroller applet</title>
    </head>
    <BODY>
    <h1>Scroller Applet</h1>
    <!--CODEBASE = "."-->
    <APPLET
      CODE     = "ScrollApplet.class"
      NAME     = "TestApplet"
      WIDTH    = 400
      HEIGHT   = 30
      HSPACE   = 0
      VSPACE   = 0
      ALIGN    = middle
    >
    <PARAM NAME="DELAYPARAM" VALUE="10">
    <PARAM NAME="TEXTPARAM" VALUE="Simple Old Scrolling Applet?">
    <PARAM NAME="BGPARAM" VALUE="#000000">
    <PARAM NAME="FGPARAM" VALUE="#CCCCCC">
    <PARAM NAME="FONTSIZEPARAM" VALUE="24">
    <PARAM NAME="FONTTYPEPARAM" VALUE="TimesRoman">
    <PARAM NAME="FONTSTYLEPARAM" VALUE="italic">
    <PARAM NAME="URLPARAM" VALUE="http://quote.yahoo.com/quotes?SYMBOLS=DISH">
    </applet>
    </body>
    </html>tajenkins

  • A javascript listening problem

    Hi all,
    I�ve an applet that assign a value to the variable feritoID whenever I make a click on the applet and this value changes related to the position of the click on the applet window.
    I need to pass to value to a javascript, so I�ve written the following:
    <html>
    <head>
    <title>ThreeDSim</title>
    </head>
    <body bgcolor="#000000" text="#FFFFFF" topmargin=0 rightmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
    <table>
    <tr>
    <td> </td></tr>
    <tr>
    <td valign="middle" align="left">
    <font size="5" face="arial">Road Accident Area</font><br>
    <applet name="ThreeDSim" code="ThreeDSimApplet" width="640" height="480"></applet>
    <br>
    </td></tr>
    <tr>
    <td>
    <script type="text/javascript">
    <!--
    var temp = document.applets[0].feritoID;
    document.writeln(temp);
    // -->
    </script>
    </td>
    </tr>
    </table>
    </body>
    </html>
    and it works�. The problem is that the javascript obviously reads the feritoID value just when it�s loaded instead I need that the javascript reads this value whenever I make a click on the applet and so, this value changes. Exist a way to perform this task?
    Bye and thanks

    Yes. You can make te javascript reload this value every time you click on a button OUTSIDE the applet. However, because the applet is defined as a whole different subprogram in relation to the browser, which is what handles the javascript, you cannot make it happen when you click on the applet (ie, the applet handles the event instead of the browser). This would be done so:
    <script language="JavaScript">
    //<!--
    var temp;
    function reloadTemp() {
         temp = document.applets[0].feritoID;
         document.writeln(temp);
    //-->
    </script>
    <input type="button" onClick="reloadTemp();">
    <applet name="ThreeDSim" code="ThreeDSimApplet" width="640" height="480"></applet>The problem you will face at this juncture is that every time you click on the button, another number will be spewed onto the page.
    Therefore, the best way of doing it is to have a <span> tag, and chage the innertext of it upon the event occuring. the reloadTemp() function now runs thus:
    function reloadTemp() {
         temp=document.applets[0].feritoID;
         document.all.ferID.innerText=temp;
    }Simply add the following html where you want the number to appear:
    <span name="ferID"></span>However, al this leaves us with one last problem: the ugly button defacing the otherwise beautiful page. As I explained above, the click event doesn't function with applets, so the best bet is to use a timer as follows:
    <body onload="reloadTemp();">
    <script language="JavaScript">
    //<!--
    var temp;
    function reloadTemp() {
         temp = document.applets[0].feritoID;
         document.all.ferID.innerText=temp;
         setTimeout("reloadTemp();",1000);
    //-->
    </script>This will reload the temp variable every second (1000 milliseconds).
    Thus, in summary:
    <body onload="reloadTemp();">
    <script language="JavaScript">
    //<!--
    var temp;
    function reloadTemp() {
         temp = document.applets[0].feritoID;
         document.all.ferID.innerText=temp;
         setTimeout("reloadTemp();",1000);
    //-->
    </script>
    <span name="ferID"></span>
    <applet name="ThreeDSim" code="ThreeDSimApplet" width="640" height="480"></applet>Hope this helps,
    SpinyNorman

  • Font problem in Applet (Urgent)

    Hi all,
    i m using a font to render the japneese character in an applet.and i m doing some text manipulations with that.and the font is TrueType font.Now if the client has that font file it renders with the japneese text.it is fine.but when the client system doesnt have the font file installed it still gives the font object(i think it is default font object supported by the JRE) which is not of TrueType.so my text manipulations behaving wrongly which i dont want to happen.If i able to find the font object returned is of TrueType or not then i can resolve this issue.
    So anybody can help me,is there any method (or anyother way to achieve it) to find whether the created font object is of TrueType or not.i have seen the Font class and its related api ,i couldnt found such method.SO can anyone help in this regard.it will be greatfull.
    thanx
    prakash

    However, if you upload the font onto your server, there is a way
    that you can use that font file, rather than relying on your user's fonts. but can any one tell me about the way to use the font file from the server , rather than relaying on the user's fonts??
    Rana.

  • Dynamic Fonts in JSP With applet

    Hi Buddies
    My Multilingual web application uses a dynamic font , the technology provided by TrueDoc.com. Now the problem is the webpage works properly by making use of the dynamic fonts and I get stuck to life when I realised that my applet should also display using the dynamic font.
    The dynamic font is a file with an extension of .pfr usually placed in the server and all the webpages will be bound to the server to make use of the .pfr font, there by making all the clients to view the sam font
    irrespective of the fonts installed in the client machine.
    How do i get going

    The applet is run on the client machine, so you have to include the .pfr with the applet code. Best bet would be to use a JAR for the Applet and package the .pfr inside there.

  • Fonts are not reflecting while running Java Applet Through Forms

    Hello Oralce Gurus!!
    I have a Java Applet which has few lines of text in different
    fonts such as AgencyFB, Verdana Ref etc., When I am running this
    applet from console, I am able to see the text in different
    fonts. Where as If I run the applet through forms (as a Bean
    (ViewerBean) ), the fonts are not reflected. The text appears in
    a default font.
    All the fonts are installed on WinNT, where the applet resides.
    I will be greatful if anyone can suggest me a solution.
    Thanks,
    Raghu

    try out this
    ImageIcon img1=new ImageIcon(this.getClass().getResource(imagename));
    for exmaple
    Imageicon img1=new ImageIcon(this.getClass().getResource("name1.jpg"));
    dont 4get to include the image files in the jar file

  • How can i get & use java true type fonts in my applet

    Hi,
    I could get the System fonts in my Applet by making use of Toolkit.getFontList()
    I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException.
    How can I get & make use True Type Fonts in my Java Applet.
    Regards
    Siva

    To use getGraphicsEnvironment, you must convert your HTML with the HTMLConverter -- this will tell the browser not to use the native JVM to run your applet but to use a Java plugin to run the applet. If you cannot find HTMLConverter in your system, you may have to download it from Sun's web site.
    V.V.

  • How to use special font in an applet so that text can viewed in any browser

    I have created an applet in which I use text with special font I have installed in my PC. The applet is correctely executed with associated html file in my PC. I try to execute the files in another PC in witch the font is not installed. Text with the special font is not correctely viewed.
    can you help me how to do?
    thanks

    Both java.awt.Component and java.awt.Graphics have a method setFont(). You can set whatever font you want. However, if the user does not have that particular Font installed, whether the font is auto-installed for the user is browser and browser-setting dependent.
    - Saish

  • How can get & use java true type fonts in my applets

    Hi
    I could get the System fonts in my Applet by making use of Toolkit.getFontList()
    I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException.
    How can I get & make use True Type Fonts in my Java Applet.
    any body knows reply immediate pls
    Siva

    similar problem:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=164516
    sorry, thats all i know.
    tobias

Maybe you are looking for