How to set font of a row in DataGrid? (FB3)

I have found examples of how to set the background color of a row based on an attribute of the data item in the row, but I cannot find anything that tells me how to set the font style. Ideally I want to choose either normal or italic based on an attribute which is not displayed in the data grid (as is possible for background color).Can anyone help?
Thanks

The first item renderer post on my blog has an example that colors text
differently.  You can use a similar technique to change the fontStyle

Similar Messages

  • How to set background color in row of JTable ?

    i am new in java please tell me about How to set background color in row of JTable ? please example code. Thnak you.

    Here is an example: http://www.javaworld.com/javaworld/javaqa/2001-09/03-qa-0928-jtable.html
    For more info on how to use tables read the swing tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    ICE

  • How  to set focus on next row inputfield in table

    Hello all,
    How  to set focus on next row input field in table
    Please help.
    Thanks in advance.
    CSP

    Hi,
    use the following code
    wdThis.wdGetAPI().requestFocus(nodeElement, attribute)
    Ex:
    Provide the attribute and replace the nodeElement with that of yours
    IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("Your attribute");
           wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(), attributeInfo);
    Regards
    Ayyapparaj

  • How to set Font in JEditorPane

    i have problem set Font in JEditorPane.please help how to set Font in JEditorPane.
    My Code,
    JEditorPane view = new JEditorPane();
    view.setEditable(false);
    view.setContentType("text/html");
    JScrollPane scroll = new JScrollPane(view);
    scroll.setMinimumSize(new java.awt.Dimension(50, 50));
    scroll.setPreferredSize(new java.awt.Dimension(450, 300));
    scroll.setAutoscrolls(true);
    scroll.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    scroll.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    view.setBorder(null);
    view.setFont(new java.awt.Font("Monospaced", 0, 12));
    view.setDragEnabled(true);
    view.setMargin(new java.awt.Insets(10, 10, 10, 10));
    view.setMinimumSize(new java.awt.Dimension(100, 20));
    view.setPreferredSize(new java.awt.Dimension(450, 300));

    Have a look at SimpleAttributeSet.

  • How to set the number of rows that an awt.Choice can display

    Dear Sir,
    I want to ask how an awt.Choice  can set the number of rows that it can display, like the method setMaximumRowCount in JCombobox. Since I want to set more row can be displayed, but choice no any method can set. And I have tried to add Jcombobox into awt.frame, then, the handling event function cannot receive event for the right-top cornet button(minimize, maximum, close).
    Best Regards,

    please post a Short, Self Contained, Correct Example showing your problem.
    bye
    TPD

  • How to set font in JTextArea

    There is a function setFont() in class JTextArea, but it seems i only can set "bold","Italic" and "font size", but i want to set something like "Times new roman" and "Courier New"
    who knows how to set?
    //

    If your Java Runtime isn't configured (for whatever reason) to see the fonts you want, setting the font's name might just set it to the default value. Hence it looks like nothing happened.
    To see what fonts are available:String[] fontNames = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
    for (int j=0; j<fontNames.length; j++)
      System.out.println(fontNames[j]);To set a font:String fontname = "Courier New";
    int style = Font.PLAIN;
    int size = 12;
    Font f = new Font(fontname, style, size);
    jtextfield.setFont(f);
    NOTE: I haven't tested the above code. But it's the right idea.

  • How to set font for  JOptionPane.showMessageDialog() ?

    Hi,
    I want to set font for JOptionPane.showMessageDialog(). I have tried with following but it did not worked.
    javax.swing.UIManager.put("JOptionPane.font", "Verdana"); Do any one have idea how to do this. Your suggestion would be helpfull to me.
    Thank you.

    Then you'll have to loop over the components in the JOptionPane and setFont for each JButton. My SwingUtils class (search the net using Darryl SwingUtils, I can't give you a link as it's blocked from my office) can make this easier.
    Sample code:import darrylbu.util.SwingUtils;
    import java.awt.Font;
    import javax.swing.*;
    import javax.swing.plaf.FontUIResource;
    public class OptionPaneFonts {
       public static void main(String[] args) {
          UIManager.put("OptionPane.messageFont", new FontUIResource(new Font(
                  "Verdana", Font.BOLD, 32)));
          SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
                new OptionPaneFonts().makeUI();
       public void makeUI() {
          JOptionPane pane = new JOptionPane("So it's a date?",
                  JOptionPane.QUESTION_MESSAGE,
                  JOptionPane.YES_NO_CANCEL_OPTION,
                  UIManager.getIcon("OptionPane.questionIcon"),
                  new String[]{"Okey-dokey", "Not on your life!",
                     "Let me think about it"
                  }, null);
          for (JButton button : SwingUtils.getDescendantsOfType(JButton.class, pane)) {
             button.setFont(new Font("Tahoma", Font.ITALIC, 18));
          JDialog dialog = new JDialog((JWindow) null);
          dialog.setModal(true);
          dialog.add(pane);
          dialog.pack();
          dialog.setLocationRelativeTo(null);
          dialog.setVisible(true);
    }db
    Edited by: DarrylBurke -- shortened the code

  • How to set the number of rows per page dynamically

    Hello all,
    i urgent need the option to set the number of rows per page dynamically.
    I've got a parameter.
    In dependence of the value of this paramter i want to set the number of rows per page of a repeating frame.
    The Reports Builder version i use is 10.1.2.0.2
    I defined a report trigger.
    My code so far:
    function R_G_BEMERKUNGFormatTrigger return boolean is
    begin
    if :vYN_Display_one_per_page = 'Y' then
    --what i've to write right here??
    return (TRUE);
    else
         return (TRUE);
    end if;
    return (TRUE);
    end;
    Can anyone help me please??
    Best regards
    Florian

    Do you just need to change back and forth between 1 and some other number? If so, you can create two identical layouts, one with the "number of rows per page" preperty (on the repeating frame) set to 1 and the other layout set to whatever. You would have to have duplicate layouts for each group you wanted to do this with. Your format trigger on the outermost master group frame where num of rows was 1 would look like:
    function M_G_ename_GRPFRFormatTrigger return boolean is
    begin
      if :vYN_Display_one_per_page = 'Y'  then
        return (TRUE);
      else
        return (FALSE);
      end if;
    end;Your format trigger on the outermost master group frame where num of rows was whatever would look like:
    function M_G_ename_GRPFR1FormatTrigger return boolean is
    begin
      if :vYN_Display_one_per_page = 'N'  then
        return (TRUE);
      else
        return (FALSE);
      end if;
      return (TRUE);
    end;

  • How to set font for title and message in JOptionPane?

    Hi,
    I have following test code.
    JOptionPane.showMessageDialog(null, "Some Alert Message", "Alert", JOptionPane.ERROR_MESSAGE);In this code can we set font for "Some Alert Message", "Alert"?
    Regards,
    Kalyani......

    roll-your-own?
    import javax.swing.*;
    class Testing
      public static void main(String[] args)
        JDialog.setDefaultLookAndFeelDecorated(true);
        JOptionPane optionPane = new JOptionPane("<html><font size='5'>Your message here</font></html>");
        optionPane.setOptionType(JOptionPane.DEFAULT_OPTION);
        optionPane.setMessageType(JOptionPane.ERROR_MESSAGE);
        JDialog dialog = optionPane.createDialog(null, "Alert");
        dialog.getLayeredPane().getComponent(1).setFont(dialog.getFont().deriveFont(18f));//size = 18/whatever
        dialog.setModal(true);
        dialog.setVisible(true);
    }

  • How to set Font to the ToolTip in JComboBox

    Hi,
    I am having problem in setting font to the ToolTip for JComboBox.
    Help needed asap...
    TIA,
    CK

    From the Mail menu bar click Mail > Preferences then select the Fonts & Colors tab.
    You can reset fonts sizes from there.
    Another way to open Mail Preferences, with Mail running, press Command ,  (comma) on your keyboard.
    The Mavericks upgrade may have reset that data to factory settings.

  • WLC AireOS 8.0 - how to set font-color for integrated webauth/weblogin?

    Hello,
    up to AireOS 7.6 I was able to set the font-color of the internal webauth/weblogin page using html-codes, for example like this:
    Headline: Welcome to our <font color="red">guest</font>-network!
    Message: You need a valid <font color="blue">user</font> to login.
    Now with AireOS 8.0 this doesn't work anymore. When I try to set a headline or message with font-tags I get "Error while setting headline." (or "...message.") when I hit apply. I have to remove the font-tag to save the weblogin page.
    #CLIWEB-6-CLIWEB_INVALID_HTML_TAGS_USED: [PA] cli_web_api.c:1748 The Customization message field has invalid html tags
    #CLIWEB-6-CLIWEB_INVALID_HTML_TAGS_USED: [PA] cli_web_api.c:1663 The Headline field has invalid html tags
    So, how can we now set different font colors/styles like in previous releases? Using external or uploading selfmade pages is not an option.
    Thanks,
    Chris

    Since your using code to change the default internal portal page look, its better for you just to create a custom webauth and upload that to the WLC.  That is how I do my implementations as its easier for me to create a new page than trying to mess around with the internal page.  As you can see, Cisco can change the way things work in every version.  It might just be the fact that they no longer are allowing html code to be inserted in the default webauth/passthrough page.
    Scott

  • How to set  color of a  row depending on the value of column in JTable?

    Hi All,
    I have a JTable that add rows when the user clicks on the button. In this way there can be any no. of rows in my table. My table contains five columns. When a new row is added , it is added with new data each time. Also the data of the rows keep on changing time to time.
    My problem is that when the data value for the third column comes out to be -ve then color of the row should be red and if its value is +ve then the color of the row should be green.
    I have tried for this in the way but it is not working properly.
    public Component prepareRenderer(TableCellRenderer renderer,int rowIndex, int vColIndex)
         Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
    if(rowIndex<table.getRowCount() && change<0 )
              c.setForeground(Color.red);
              c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    else if(rowIndex<table.getRowCount() && change>0)
    c.setForeground(new Color(20,220,20));
         c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    return c;
    where change is the value of the third column.
    Any help is highly appreciated.
    Thanx in advance.
    Regards,
    Har Krishan

    Perhaps you'll find this link useful. It gives a general idea of how you can create and adjust your custom renderer:
    http://www.senun.com/Left/Programming/Java_old/Examples_swing/JTableExamples4.html
    Hope it helps.
    Eugene

  • How to set Fonts size in X (whole system)

    Hi,
    I just bought a 19" monitor, and finally, got my resolution up from 800x600 to find out that i cant get to increse the xterm, Eterm, Firefox, Thunderbird, Gaim and everything to have an acceptable font size...
    I mean, is there a way to set the whole system font to some minimal size?
    I know how to change in almost every app (have to see if they can remember it, but thats just checking) but there are some i dont... xterm for example...ive looked at the man page, but there are so many options (just with the font subject, i do use several of the other flags) that i couldnt find the one i wanted, just to increase the font size... in Eterm there are 4 pre-set sizes, although i would like to increse it a bit more...
    I use Enlightenment, so i dont have any Gnome/KDE control center to do anything...
    As usual, any tips are welcome!
    Thanks!

    I can't provide much help but I can give you a hint: change the DPI globally with... one sec... xfce has some sort of script for settings the DPI globally...
    This is the part where the DPI is set
    # Those are my settings, change them as appropriate...
    # Xft DPI: 96
    # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
    # Xft hinting: 1/0
    xrdb -nocpp -merge - << EOF
    Xft.dpi: 96
    Xft.hinting: 1
    Xft.hintstyle: hintmedium
    EOF
    You might run the command with another DPI setting...
    xrdb can be found in /usr/X11R6/bin.
    Once again, this is just a thought, I don't know how successful this change will be. Good luck.
    You might want to have a look on Google.
    IceRAM

  • How to set font Color in Mail

    Sometime ago I set in Mail the default font to Arial, and the default font Size to 18, so when I write a new email these are my default font and size. But I could not set the font Color. How do I do this?

    Sounds like you have the Preferences toolbar closed on another selection.
    Go to Mail > Preferences and at the top right of the Preferences window is a clear pill shaped button.
    Selecting this button opens/closes the complete Preferences toolbar.

  • How to set font size...

    Hi, I'm trying to make the font size of a link 16px, how can I do this? I am trying:
    Currently, I have:
    <b><hbj:link
    id="link1"
    text="Link to google"
    reference="http://www.google.com"
    target="_TOP"
    tooltip="this takes you to: http://www.google.com"
    onClick="LinkClick">
    <% link1.setFontSize(LinkFontSize.STANDARD);%>
    </hbj:link></b>
    But I would like the size of the font link to be 16px.
    I see that there is a constructor available in the JavaDocs but it is protected, how would I be able to use it?
    I'm a beginner in JSP and Java, so any examples, code, or suggestions are greatly appreciated!
    Thanks so much!
    Baggett.

    You can't use the LinkFontSize to change the font size but you have an alternative. you could do the following. You can pass your text for your link in html text and set the encoding to false.
    <b><hbj:link
    id="link1"
    text="<h1>Link to google</h1>"
    reference="http://www.google.com"
    target="_TOP"
    tooltip="this takes you to: http://www.google.com"
    onClick="LinkClick">
    <% link1.getInnerText().setEncode(false);%>
    </hbj:link></b>
    PS: Please Post your question in one forum.

Maybe you are looking for

  • SC 3.2 & Oracle

    Hi all: 2 nodes and 7-30 databases. Start in 7 databases and grow to 30. So I guess I need 7-30 resource group, 1 per database. This 7-30 are spread in both nodes. If 1 node fails, databases switch to the other node. Which is overhead of switching 10

  • [SOLVED] What is this sorting algorithm? (or a new one?)

    Hello everyone! Just before starting, i apologize for my grammar mistakes. I found a new sorting algorithm but i'm not sure if i really found it. There are too many sorting algorithms and mine is a really simple one; so, i belive that it can be found

  • "Go back" in Finder

    When I was still using Snow Leopard, I can use 2 fingers sliding to go back to previous page in Finder. However, I can't do it in Lion. How can I get back this function?

  • 1G iTouch won't wake up after sleep

    1G iTouch won't wake up after sleep. When I plug it back into my laptop it does a complete reboot. Tried both reset and restore. Works fine as long as plugged in. It shows a full battery and drains properly but once it goes to sleep it acts like batt

  • User calendar web URL

    For groups: http://server/groups/groupname/ works great... problem is, does something like this exist for user calendars?