[JLabel] HTML + Font

Hi,
I have a JLabel in which I use HTML to color my text (the color is not the same for all the text)?
ex :
JLabel label = new JLabel("<html><body>font color='blue'>hi</font> to <font color='red'>you</font></body></html>);
Then, I set a customized font that I load dynamically:
InputStream inputFont = this.getClass().getResourceAsStream("my_font.ttf");
Font font = Font.createFont(Font.TRUETYPE_FONT, inputFont);
MY_FONT = font.deriveFont(24f);
label.setFont(MY_FONT);
*My problem is:*
When I do that, the font is not applied (problably because of HTML font tags). I just see for a moment my font with the HTML tags, and when the HTML is parsed, the default font comes back. I've tried to change <font> by <span>, it does just the same)
When I remove HTML tags from my JLabel, like new JLabel("plop") and apply my customized font, I have no problem and my font is applied (but I don't have the colors that I want).
Problem is I want both of it! My customized font AND colors.
Do you know how to do that?
I hope I made myself clear,
Thanks :)

I've been playing with this a bit more with very peculiar results.
Run the code. Without resizing the window, scroll down. Many fonts (Symbol, Wingdings ...) are rendered as square boxes in the right (non-html) list but the font names are readable in the left (html) list.
Now maximize the window and look again. What's going on here?import java.awt.*;
import javax.swing.*;
public class FontHtmlProblem {
   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
         @Override
         public void run() {
            new FontHtmlProblem().makeUI();
   public void makeUI() {
      GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      Font[] fonts = ge.getAllFonts();
      JList listHtml = new JList(fonts);
      listHtml.setCellRenderer(new DefaultListCellRenderer() {
         @Override
         public Component getListCellRendererComponent(JList list,
               Object value, int index,
               boolean isSelected, boolean cellHasFocus) {
            Font thisFont = (Font) value;
            setFont(thisFont.deriveFont(16f));
            setText("<html><body>" + thisFont.getName() + "</body></html>");
            return this;
      JScrollPane scrollHtml = new JScrollPane(listHtml);
      scrollHtml.setColumnHeaderView(new JLabel("HTML"));
      JList listPlain = new JList(fonts);
      listPlain.setCellRenderer(new DefaultListCellRenderer() {
         @Override
         public Component getListCellRendererComponent(JList list,
               Object value, int index,
               boolean isSelected, boolean cellHasFocus) {
            Font thisFont = (Font) value;
            setFont(thisFont.deriveFont(16f));
            setText(thisFont.getName());
            return this;
      JScrollPane scrollPlain = new JScrollPane(listPlain,
            JScrollPane.VERTICAL_SCROLLBAR_NEVER,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
      scrollPlain.setColumnHeaderView(new JLabel("Plain"));
      scrollPlain.getVerticalScrollBar().
            setModel(scrollHtml.getVerticalScrollBar().getModel());
      scrollPlain.removeMouseWheelListener(
            scrollPlain.getMouseWheelListeners()[0]);
      scrollPlain.addMouseWheelListener(
            scrollHtml.getMouseWheelListeners()[0]);
      JFrame frame = new JFrame();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setLayout(new GridLayout(1, 2));
      frame.add(scrollHtml);
      frame.add(scrollPlain);
      frame.pack();
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
}db

Similar Messages

  • Changing a JLabel's font

    Anybody know how to change a JLabel's font? ( I would prefer not having to overide paintComponent)

    Try using the setFont method:
    JLabel label = new JLabel("Some Text");
    label.setFont(new Font("dialog", Font.PLAIN, 12));
    The Font constructor takes a font name, font style, and size.
    Check out http://java.sun.com/j2se/1.3/docs/api/javax/swing/JLabel.html and http://java.sun.com/j2se/1.3/docs/api/java/awt/Font.html

  • JLabel/html question

    how do you make a tab in html within a JLabel text.
    also how do you get rid of the bold that seems to be on every J label?

    Thanks Kel, I'm not using metal, but maybe that third line should do what I want?
    and Quack, I do whole heartedly agree with you, but this is something that I HAVE to finish by tomorrow. Considering I had quite a good bit more to do, and the way that I have done it seems to work just fine, I decided to leave it as is. If I finish with enough time, I will likely go back and implement that cardLayout like you suggested.
    Although I am curious, what is wrong specifically with how I have done it? (As for how the GUI components are changed)
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.text.*;
    import java.util.*;
    public class Holder extends JFrame implements ActionListener
        static Scanner scan;
        static int returnFileVal;
        static int index;
        static int totalEmployees;
        static double grossPayCalc;
        static double totalGross;
        static double totalFICA;
        static double totalFED;
        static double totalInsur;
        static double totalNet;
        static String data;
        static String totals;
        static File file;
        static ArrayList TermCode = new ArrayList();
        static ArrayList EmpID = new ArrayList();
        static ArrayList FName = new ArrayList();
        static ArrayList MName = new ArrayList();
        static ArrayList LName = new ArrayList();
        static ArrayList Suffix = new ArrayList();
        static ArrayList HourRT = new ArrayList();
        static ArrayList HourWK = new ArrayList();
        static ArrayList Dep = new ArrayList();
        static ArrayList Insur = new ArrayList();
        static ArrayList YTDGR = new ArrayList();
        static ArrayList YTDFICA = new ArrayList();
        static ArrayList YTDFED = new ArrayList();
        static ArrayList grossPay = new ArrayList();
        static ArrayList FICA = new ArrayList();
        static ArrayList FED = new ArrayList();
        static ArrayList netPay = new ArrayList();
        static ArrayList dataList = new ArrayList();
        static Holder f;
        static Container c;
        static JPanel homePanel = new JPanel();
        static JPanel firstRow = new JPanel();
        static JPanel secondRow = new JPanel();
        static JPanel thirdRow = new JPanel();
        static JPanel fourthRow = new JPanel();
        static JPanel fifthRow = new JPanel();
        static JPanel sixthRow = new JPanel();
        static JPanel seventhRow = new JPanel();
        static JPanel eighthRow = new JPanel();
        static JPanel ninthRow = new JPanel();
        static JLabel hoursWorkedLabel = new JLabel("Default hours worked:");
        static JTextField hoursWorkedField = new JTextField("40",2);
        static JButton processButton = new JButton ("Process payroll for all non-terminated employees");  
        static JButton closeButton = new JButton ("End Program");
        static JLabel chooseFileLabel = new JLabel("Select the payroll file");
        static JFileChooser fc = new JFileChooser();
        static JPanel filePanel = new JPanel();
        static JTextField fileChooseField = new JTextField(25);
        static JButton fileChooseButton = new JButton("Find");
        static JButton fileOKButton = new JButton("Process");
        static JButton fileBackButton = new JButton ("Back");
        static JPanel processPanel = new JPanel();
        static JLabel pleaseSelectLabel = new JLabel("Please select an option.");
        static JButton payrollJournalButton = new JButton("View the payroll journal");
        static JButton checkButton = new JButton ("View the checks");
        static JButton checkStubButton = new JButton ("View the check stubs");
        static JLabel payrollJournalTitle = new JLabel("<html><b><u>Payroll Journal</u></b></html>");
        static JButton payrollBack = new JButton("Back");
        static JPanel payrollPanel = new JPanel();
        static JList payrollList = new JList();
        static JLabel payrollEmployeeData = new JLabel();
        static JLabel payrollSubtitles = new JLabel ("EmpID\t\tName\t\tGross Pay\t\tFICA\t\tFED\t\tInsur\t\tNet Pay");
        static JLabel payrollTotals = new JLabel();
        static JScrollPane payrollScroll = new JScrollPane();
        public static void main(String[] args)
            f = new Holder();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setSize(450,300);
            f.setTitle("Payroll");
            f.setResizable(false);
            f.setLocation(200,200);
            f.setVisible(true);
            createHome();
        public Holder()
            c = getContentPane();
        public void actionPerformed(ActionEvent e)
        public static void createHome()
            firstRow.removeAll();
            secondRow.removeAll();
            thirdRow.removeAll();
            homePanel.removeAll();
            homePanel.setLayout(new GridLayout(3,1));
            FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
                firstRow.setLayout(rowSetup);
                secondRow.setLayout(rowSetup);
                thirdRow.setLayout(rowSetup);
            firstRow.add(hoursWorkedLabel);
            firstRow.add(hoursWorkedField);
            secondRow.add(processButton);
            thirdRow.add(closeButton);
            homePanel.add(firstRow);
            homePanel.add(secondRow);
            homePanel.add(thirdRow);
            closeButton.addActionListener(new endProgram());
            processButton.addActionListener(new processPayroll());
            c.remove(filePanel);
            c.add(homePanel);
            c.validate();
            c.repaint();
        public static void createPayroll()
            filePanel.removeAll();
            filePanel.setLayout(new GridLayout(3,1));
            FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
                firstRow.setLayout(rowSetup);
                secondRow.setLayout(rowSetup);
            firstRow.removeAll();
            secondRow.removeAll();
            thirdRow.removeAll();
            fileChooseButton.addActionListener(new fileChooser());
            fileBackButton.addActionListener(new fileBack());
            fileOKButton.addActionListener(new processFinal());
            firstRow.add(chooseFileLabel);
            secondRow.add(fileChooseField);
            secondRow.add(fileChooseButton);
            thirdRow.add(fileBackButton);
            thirdRow.add(fileOKButton);
            filePanel.add(firstRow);
            filePanel.add(secondRow);
            filePanel.add(thirdRow);
            c.remove(homePanel);
            c.add(filePanel);
            c.validate();
            c.repaint();
        public static void processFinal()
            try
                scan = new Scanner(new BufferedReader(new FileReader(file)));
            catch(IOException io)
                System.out.println("The file cannot be opened");
            scan.useDelimiter(",");
            index = 1;
            totalEmployees = 0;
           while (scan.hasNext())
               int type = index%13;
               switch (type)
                    case 1: TermCode.add(scan.next());
                            totalEmployees++;
                            break;
                    case 2: EmpID.add(new Integer(scan.next()));
                            break;
                    case 3: FName.add(scan.next());
                            break;
                    case 4: MName.add(scan.next());
                            break;
                    case 5: LName.add(scan.next());
                            break;
                    case 6: Suffix.add(scan.next());
                            break;
                    case 7: HourRT.add(new Double(scan.next()));
                            break;
                    case 8: HourWK.add(new Integer(scan.next()));
                            break;
                    case 9: Dep.add(new Integer(scan.next()));
                            break;
                    case 10:Insur.add(new Double(scan.next()));
                            break;
                    case 11:YTDGR.add(new Double(scan.next()));
                            break;
                    case 12:YTDFICA.add(new Double(scan.next()));
                            break;
                    case 0: YTDFED.add(new Double(scan.next()));
                            break;
                index++;
            for (index = 0; index < totalEmployees; index++)
                if ((Integer)HourWK.get(index) > 40)
                    grossPayCalc = (((Integer)HourWK.get(index)-40)*(Double)HourRT.get(index)*1.5);
                    grossPayCalc += (40*(Double)HourRT.get(index));
                else
                    grossPayCalc = ((Integer)HourWK.get(index)*(Double)HourRT.get(index));
                grossPay.add(grossPayCalc);
                FICA.add((Double)grossPay.get(index)*.0765);
                FED.add((290-65*(Integer)Dep.get(index))*.15);
                netPay.add((Double)grossPay.get(index)-((Double)FICA.get(index)+(Double)FED.get(index)+(Double)Insur.get(index)));
            firstRow.removeAll();
            secondRow.removeAll();
            thirdRow.removeAll();
            c.remove(filePanel);
            processPanel.setLayout(new GridLayout(4,1));
            FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
                firstRow.setLayout(rowSetup);
                secondRow.setLayout(rowSetup);
                thirdRow.setLayout(rowSetup);
                fourthRow.setLayout(rowSetup);
            firstRow.add(pleaseSelectLabel);
            secondRow.add(payrollJournalButton);
            thirdRow.add(checkButton);
            fourthRow.add(checkStubButton);
            payrollJournalButton.addActionListener(new viewJournal());
            processPanel.add(firstRow);
            processPanel.add(secondRow);
            processPanel.add(thirdRow);
            processPanel.add(fourthRow);
            c.add(processPanel);
            c.validate();
            c.repaint();
        public static void createFileChooser    ()
            returnFileVal = fc.showOpenDialog(filePanel);
            if (returnFileVal == JFileChooser.APPROVE_OPTION)
                file = fc.getSelectedFile();
            fileChooseField.setText(file.toString());
        public static void createJournal()
            f.setSize(700,500);
            firstRow.removeAll();
            secondRow.removeAll();
            thirdRow.removeAll();
            fourthRow.removeAll();
            c.remove(processPanel);
            payrollPanel.setLayout(new GridLayout(9,1));
            FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
                firstRow.setLayout(rowSetup);
                secondRow.setLayout(rowSetup);
                thirdRow.setLayout(rowSetup);
                fourthRow.setLayout(rowSetup);
                fifthRow.setLayout(rowSetup);
                sixthRow.setLayout(rowSetup);
                seventhRow.setLayout(rowSetup);
                eighthRow.setLayout(rowSetup);
                ninthRow.setLayout(rowSetup);
           data = new String("<html>");
           for (index = 0; index < totalEmployees; index++)
               data += (Integer)EmpID.get(index);
               data += "\t\t";
               data += ((String)FName.get(index) + " ");
               if (((String)MName.get(index)).equals(" ")==false)
                   data += ((String)MName.get(index) + ". ");
               data += ((String)LName.get(index) + " ");
               data += (String)Suffix.get(index);
               data += "\t\t";
               data += (Double)grossPay.get(index);
               data += "\t\t";
               data += (Double)FICA.get(index);
               data += "\t\t";
               data += (Double)FED.get(index);
               data += "\t\t";
               data += (Double)Insur.get(index);
               data += "\t\t";
               data += (Double)netPay.get(index);
               data += "</br>";
           data += "</html>";
           for (index = 0; index < totalEmployees; index++)
               totalGross += (Double)grossPay.get(index);
               totalFICA += (Double)FICA.get(index);
               totalFED += (Double)FED.get(index);
               totalInsur += (Double)Insur.get(index);
               totalNet += (Double)netPay.get(index);
           totals = new String ("Final Totals\t\t\t\t" + totalGross + "\t\t" + totalFICA + "\t\t" + totalFED + "\t\t" + totalInsur + "\t\t" + totalNet);
           payrollTotals.setText(totals);
           payrollEmployeeData.setText(data);
           firstRow.add(payrollBack);
           payrollBack.addActionListener(new processPayroll());
           secondRow.add(payrollJournalTitle);
           fourthRow.add(payrollSubtitles);
           fifthRow.add(payrollEmployeeData);
           eighthRow.add(payrollTotals);
           payrollPanel.add(firstRow);
           payrollPanel.add(secondRow);
           payrollPanel.add(thirdRow);
           payrollPanel.add(fourthRow);
           payrollPanel.add(fifthRow);
           payrollPanel.add(sixthRow);
           payrollPanel.add(seventhRow);
           payrollPanel.add(eighthRow);
           payrollPanel.add(ninthRow);
            c.add(payrollPanel);
            c.validate();
            c.repaint();
    class endProgram implements ActionListener
        public endProgram()
        public void actionPerformed(ActionEvent e)
            int answer = JOptionPane.showConfirmDialog(null,"Are you sure you want to end the program","f",JOptionPane.YES_NO_OPTION);
            if (answer == JOptionPane.YES_OPTION)
            System.exit(0);
    class processPayroll implements ActionListener
        public processPayroll()
        public void actionPerformed(ActionEvent e)
            Holder.createPayroll();
    class fileChooser implements ActionListener
        public fileChooser()
        public void actionPerformed(ActionEvent e)
            Holder.createFileChooser();
    class fileBack implements ActionListener
        public fileBack()
        public void actionPerformed(ActionEvent e)
            Holder.createHome();
    class processFinal implements ActionListener
        public processFinal()
        public void actionPerformed(ActionEvent e)
            Holder.processFinal();
    class viewJournal implements ActionListener
        public viewJournal()
        public void actionPerformed(ActionEvent e)
            Holder.createJournal();

  • How does "HTML font size"  work ?

    I spent a long time fighting with the <html> <Font. face=serif size=xxx>
    Originally I tried to set the size to 24, 20, 18 or -1, or -2. This gave strange results. Either my letter size was much higher than I was expecting, or very small when using negative numbers.
    After many tries, I noticed that by using size=1, size=2, size= 3, and so on, works much better.
    So I'm looking for information about the relationship between these values and the heigth (or width) number of points.
    Thanks to anyone who may help me.
    Gege

    The <font> tag is depreacted.
    "What's Wrong With FONT?" - http://www.mcsr.olemiss.edu/%7Emudws/font.html
    Use something like styles instead. You'll see that the font sizes aren't as surprising this way.
    Example:
    These should all be about the same size (using IE).
    Note that the third (using percentage) will change when
    the user changes their browser's text size (ie: View -> Text Size)
    <span style="font-size:16px">Text</span><br/>
    <span style="font-size:12pt">Text</span><br/>
    <span style="font-size:100%">Text</span><br/>See also - http://www.w3schools.com/html/html_fonts.asp

  • IMPORTANT!! JLabel+HTML

    Hello.
    i use some JLabel to display HTML text. but, how can i justify a text in a JLabel with HTML????
    i tried "<html><p align="justify">test test test</p></html>" "<html><p style="text-align=justify>test test</p></html>" and many over possibility (with or without quote mark...), and no one works!:-/
    help me pleaze. thanks.
    PS : sorry for my bad english.!:-/

    Hiii,
    Just try with the following code
    Change align=left or right as u need to note the difference
    import javax.swing.*;
    import java.awt.*;
    class TestScreen1 extends JFrame
         JLabel llog;
         Container c;
         public TestScreen1()
              super("Entry Screen");
              c=getContentPane();
              c.setLayout(null);
              llog = new JLabel("<html><p align=\"right\">test <br> temp rigt<br> test</p></html>");
              llog.setBounds(10,10,250,90);
              c.add(llog);
              setBounds(240,190,310,250);
              setVisible(true);
         public static void main(String args[])
              final JFrame f=new TestScreen1();
              f.addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent e)
                   System.exit(0);
    Karthik

  • JEditorPane displays html font very large.

    I have a JEditroPane embedded into a JScrollPane. The url for the EditorPane is an html file. It laods and displays. However, my html font is set to 8 but what is displayed appears to be at 12 point or higher. Is there a way to alter the font size of the html text displayed inside the JEditorPane?
    Thanks.

    Can anyone explain how to change the font size for the
    entire html document set to the JEditorPane? The
    default size is too large and any attmept to perform a
    setFontSize fails.
    Thanks.I'm posting this to save you time by letting you give up hope on finding some simple solution to your problem.
    There may not be any.
    I've just tried loading my html file into a JEditorPane and all characters appear in default regular size. It seems JEditorPane is not processing any stylesheets info which I use to define all text attributes.
    The API document says:
    "text/html
    HTML text. The kit used in this case is the class javax.swing.text.html.HTMLEditorKit which provides HTML 3.2 support. "
    3.2 is pretty old, isn't it? What's the HTML version you used to create your HTML files?
    How do you set font size in your html files? A sample html file from Sun for a Text demo program uses the following and it seems to work:
    <font size=-2>from</font> a
    <font size=+2">URL</font>
    If you decide to modify your existing HTML files, use the above format.
    (Wait! Why do we need to modify perfectly working html files to make them appear normal in Java programs? It should be the other way around! :D)

  • Embedded html font removes spaces!

    I have a dynamic html textField which has embedded fonts.
    When I provide it with html, it is displaying formatted text
    (italic, bold, underline, etc) incorrectly. it removes a space
    directly in front of the formatted word.
    e.g. unformatted:
    hello world
    formatted:
    hello
    World
    I have tried placing the space inside and outside the format
    tag and it makes no difference. Switching off the embed makes the
    field display correctly, however my client wants embedded,
    anti-aliased text.
    This seems to occur quite randomly so that some formatted
    text in the same textfield does not display incorrectly, while some
    does!
    There are font symbols for all my formatted fonts in the
    library.
    Can anyone shed some light?

    Is the SPACE character included as well?
    smon_ed wrote:
    > Thanks for your reply.
    >
    > I have included all my required fonts seperately in the
    library. So all my
    > fonts are embedded as symbols and available to my
    dynamic textfields, which I
    > believe does the same thing as placing embedded
    texfields on frame 1 of the
    > movie, which I tried and which did not help.
    >
    > This seems to occur not just for ordinary formatting,
    but also for underlining
    > and font changing, which is specific to TextFormat
    object formatting. I donlt
    > see this effect when not using TextFormat object and
    when not using htmlText.
    >
    > I am greatly, massively, annoyingly stuck on this and
    it's a really really
    > really important thing! Pretty much crucial to the whole
    application!!
    >
    Manno Bult
    http://www.aloft.nl
    [email protected]

  • JEditorPane HTML font style changing problems

    I have tried changing the font size using the action:
    StyledEditorKit.FontSizeAction("12", 12)
    but that seems to have problems. When I change it on the editor and write and re-read the change html the font size does not look the same.
    Is there a bug in changing the font size of htmls using the JEditorPane or JTextPane component?
    How/What does the "font-change-bigger" or "font-change-smaller" work with in the HTMLEditorKit? Should I be using these members somehow instead?

    Hello,
    When you use HTMLEditorKit, you can not specify font out size of HTML. For Example, use FONT tag in html to set your font. There are many ways to change font in html. tags like h1, h2 etc..
    O.K.

  • HTML font anti-alias issue (Windows)

    I'm using an HTML component in my AIR app to display a bunch of content.  I recently changed over to using the HTML component instead of other Flex components like Text and TextArea.
    The problem I have is that text in the HTML component is always displaying anti-aliased on Windows, whereas it didn't before when I was using other Flex components.  Is there a way I can prevent the HTML component from rendering fonts with anti-aliasing?  I've tried several WebKit CSS properties, but none of them have seemed to work (including text-smooth and text-shadow).  I also didn't see any properties on the HTML or HTMLLoader components which allowed me to change font rendering.
    Does anyone know how I might solve this?

    No one knows?

  • Problems setting HTML font

    Hello people.
    I'm having troubles setting the font face in an html table
    that I am displaying in a text member.
    Here is what I am trying:
    -- set font for HTML
    put "<FONT FACE="ARIAL">"&RETURN after htext
    I'm getting an error message claiming that I am using a
    variable before it has been assigned (I assume that it thinks that
    ARIAL is a variable). Am I right in thinking that the extra
    quotation marks aren't helping?
    Any tips?

    That doesn't seem to be doing the trick.
    Here is the complete Lingo for the HTML table (using one of
    Sean Wilson's suggestions ):
    -- display a list of all the students using HTML
    on displayDatabase
    -- HTML header
    htext = "<HTML><BODY
    BGCOLOR=#FFFFFF>"&RETURN -- need to specify font for table
    display
    -- set font for HTML
    put "<FONT FACE='ARIAL'>"&RETURN after htext
    -- put the table headings
    put
    "<TABLE><TR><TH>Username</TH><TH>Password</TH></TR>"\
    &RETURN after htext
    -- loop through database and create table rows
    repeat with i = 1 to gDatabase.count
    put "<TR>" after htext
    put "<TD>" & gDatabase.getPropAt(i) &
    "</TD>" after htext
    put "<TD>" & gDatabase[gDatabase.getPropAt(i)]
    & "</TD>" after htext
    put "</TR>"&RETURN after htext
    end repeat
    -- close out table and HTML
    put "</TABLE></BODY></HTML>" after htext
    -- place HTML in text member
    member("Student Database Display").html = htext
    end
    Any ideas?

  • HTML font size in Oracle Reports 11g

    I am migrating from Oracle Reports 10g in OAS to Reports 11g in WebLogic.
    However when I display all changed reports using Web Browser (same), the font size is changed(comparing the 10g reports to 11g reports). I would like to keep unchanged.
    (command using DESTYPE=HTML)
    May anybody can give me some guidance? (would like to see if there are any file or setting in EM which can alter the size of font in web)
    Thanks.
    Edited by: 817748 on 2011/7/19 上午 9:45

    There is a better forum: {forum:id=84} for your question

  • Muse website exported to html, fonts differ on tablet.  how can I fix this so font is same on all, using comic sans

    When viewing website on desktop, font is as it should be.  However on my tablet and phone font is different.  What can I do to correct this ... Do I need to create a separate website for Desktop, tablet and phone? 

    Hi Abhishek,
    I reviewed your screenshot.  Fonts selected are web safe.  I edited the global stylesheet in Dreamweaver after exporting to html to reflect the desired web safe font.  Now fonts are very inconsistent.  Some are as they should be and others are not.  See screenshots. 
    Is there anyone else that knows of a solution or is this a glitch that has not been resolved yet?
    See my screenshots below from the iPad version of the website that I created originally in Muse and then exported the HTML for fine -tuning in Dreamweaver

  • HTML Font alignment

    Hi All.
    I am using the FM WWW_HTML_FROM_LISTOBJECT to convert my list to HTML.
    Users want to change the font to ARIAL.
    So I changed the template in SMW0 to change the font. But then all my alignment got lost.
    I then coded 2 test HTML scripts to see how font behaves. Here is it :
    <HTML>
    <HEAD> </head>
    <body>      
    <font face="Courier" size="2.0"> Testing font
         Second column
    <br>
    2nd row test      second column
    </body>
    </html>
    Re-run the above script changing the face to ARIAL and you'd see a different alignment.
    Now, is there any way to preserve my alignment so that even if I change the font face, my alignment remains the same. I tried <PRE> tag, but doesn't work. Any clues anyone please?
    Thanks in adv.

    hi
    good
    i dont think there is no such process which can help you to preseve the current font setting, and HTML behaves as per the change ot the font color and font size, but it does not change the alignment of the page,if it is changing the alignment of your page than check out if there is any box you have put in the HTML screen and the lengh of any other window that you have put in the HTML page.
    thanks
    mrutyun^

  • Chinese fonts in html not showing up properly sometimes

    I have the following lines in my program :
    JLabel A_Label=new JLabel("<Html><Font Size=3>\u8F93\u5165</Font></Html>");
    JPanel A_Panel=new Jpanel();
    A_Panel.add(A_Label);
    Sometimes the Chinese shows up correctly, but sometimes it shows up as blank rectangles, if I change the font size to 5, it will always show up, why ? How can I make it always show up in size 3 font ?
    Frank

    Hi, thanks for replying.
    I know it works for JLabel without html, but I need to display a lot of information in the label, there are formatted tables, different size fonts, html input fields, etc. , so my only choice is to use html to format them.
    I found it has something to do with the power of the PC running it, isn't it strange ? When the program starts, it needs to initialize, takes a while, from a few seconds to half a minute, sometimes if it didn't have a lot of data to load, the fonts shows up correctly, other times when it takes a while to load a lot of data before it displays the html formatted JLabel, the fonts may not all show up correctly. Size 5 always shows up correctly, the size 3 & 4 font sometimes could show up as blank rectangles.
    I wonder if there is anything I can do in my program to stabilize this when I use html in JLabel ?
    Frank

  • Html bold in jLabel in linux

    Hi,
    I'm trying to put Html in a Label. However the bold isn't working under linux. In windows it works. But in linux it doesn't. I tried playing around with it. But nothing worked for me.
    zText1 = "test";
    zText2 = "test";
    zLabel.setText("<html><font size=\"4\" face =\"Courier\"><b>" + zText1 + "</b>  " + zText2 + "</font></html>"); Thanks,
    Shaul

    In the future, please ask swing questions in the swing forum.
    It would appear that the default font for JLabel and JButton is bold.
    import java.awt.Font;
    import javax.swing.JLabel;
    public class BoldHtml extends javax.swing.JFrame {
        public BoldHtml() {
            final JLabel label =
                new JLabel("<html><font size=\"4\" face =\"Courier\">test <b>test</b>  <i>test</i></font></html>");
            label.setFont(label.getFont().deriveFont(Font.PLAIN));
            add(label);
            pack();
        public static void main(String args[]) {
            new BoldHtml().setVisible(true);
    }

Maybe you are looking for

  • Sort field in VF31

    Hi, Pls anybody let me know what is the functionality of field "Sort order" in VF31 screen? what is the meaning of this feild and for what purpose we use this field? thanks & Regards, Srikanth.P

  • How to set crystal report image object's file path dynamically from file system in vb 2010

    I using visual studio 2010 and sap crystal report is installed on it. I have a report with picture box on it and i need to load image to this picture box from vb e.i. Dim imgPhoto As CrystalDecisions.CrystalReports.Engine.PictureObject = crShortRepor

  • Can connect to skype but not subscription

    I can connect to my account but I cannot connect to used my suscription I can not make any calls Post transferred from outdated, irrelevant thread to create new topic. Subject/title edited accordingly.

  • COLLECTION OF MULTIPLE IDOC

    Hi All, I am working with a scenario to collection of multiple idoc using BPM . I am working with this scenario https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2034.The [original link is broken] [original link is broken] [original link is broke

  • Keyframe Warp Stabilizer

    I'm going to end up doing this the hard way, but I thought I'd ask to see if a workaround exists--I haven't found one anywhere online. I am stabilizing a jib shot for a series I'm working on--the move on the jib is fluid and perfect, there is just a