How to change font in just one column of JTable

I have a table with 4 column.
I want to have Courier font in column number 2, and Arial in columns number 1, 3 and 4.
With:
table.setFont(new Font("Courier New", Font.PLAIN, 12));
I can set fonts in all columns but how to set font in just one column.
Thanks
Srdan

Hi,
there are 2 methods of JTable where every rendering resp. editing component "comes" through - prepareRenderer(...) and prepareEditor(....) - by overwriting this methods and calling its super method first you get the component and can manipulate it before you return it. This component is exactly that, what is used for rendering resp. editing afterwards.
greetings Marsian

Similar Messages

  • How to change font size of OATableBean Column Headers

    Dear All,
    I am facing a problem, senario is i am having a table layout with about 20 columns and each column header is about 30 characters long now the problem is when the table is rendered because of header font size its layout is not good looking ... is there any way that i can controll the font size of colmun headers.
    I have tried this solution provided in this forum:
    CSSStyle csNum = new CSSStyle();
    csNum.setProperty("font-size", "8");
    OAPageLayoutBean plb = pageContext.getPageLayoutBean();
    OAMessageStyledTextBean columnBean = (OAMessageStyledTextBean) plb.findChildRecursive("Description");
    columnBean.setInlineStyle(csNum);
    but it only change font size of column data not the header.
    Thanks in advance.

    Hi,
    // Get a handle to the column's header
    OAColumnBean columnBean =
      (OAColumnBean)tableBean.findIndexedChildRecursive("<columnBeanId>");
    OASortableHeaderBean colHeaderBean =
      (OASortableHeaderBean)columnBean.getColumnHeader();
    colHeaderBean.setText("<newText>");Regards,
    Gyan

  • How to change font size, maximum column size in the result screen ?

    hi All
    That's great when using SQL Dev.
    But I also have a trouble that how to change font size, maximum column size in the result screen ?
    My users think that font in result screen is shown very small, and whenever the data in each colum is long then it's not shown full data in column, they must double click for extend the size. Have the option to default the max size for showing full data in each column ? I try but still not to do that .
    Appreciate for anyone to help us.
    Thanks all.
    Sigmasvn

    You can't change the font for the results screen yet, however you will be able to select an auto-fit option for selected columns, so if some columns have slitghtly wider text you'll be able to set the column widths to handle these wider columns.
    Also, there s the option of switching the layout of a record in the grid.
    Sue

  • I have to Apple ids in email format--how can I change this to just one and merge all of my existing purchases and apps under one ID?

    I have two apple id's in email format--how can i change this to just one and merge all of my apps and tunes under the one retained ID?

    Sorry Duane..
    Apple does not support the merging of accounts >   Frequently Asked Questions About Apple ID
    messaged edited by cs

  • How to change fonts in iCal?

    How to change fonts in iCal?  I can't harly read my calendar-tiny print size.  How could I change the font size?

    Your question really got me thinking.   Actually, I don't think you should feel like an idiot at all.  I think it is Apples failure that they made this difficult.  Seriously, who would ever think to press Command and arrow to switch months?  The little arrows next to the word Today are so small and inconspicuous that I remember having this very same question when I started using iCal too. 
    So, here is what I did to make it easier for my wife that uses iCal too. 
    Open System Preferences, Keyboard, Keyboard Shortcuts Tab, and finally Application Shortcuts.
    Click on the Plus symbol under the right hand pane.
    Select iCal from the Application list
    Add two shortcuts:  One named Next and the other named Previous and press your desired Keyboard Shortcut.
    I assigned the left arrow and right arrow for these tasks.
    Now it makes more sence for someone that is not used to Apples idotic way of doing things. ;-)
    I use keyboard shortcuts all over the place.  Actually, sometimes it gets me into trouble when I use someone elses computer and my shortcuts don't work.  I blame their computer for it and forget it was my "tuning".

  • How to change Font Size of Object Explorer in "SQL Server Management Studio"

    Dear Team,
    "SQL Server Management Studio" is a fantastic IDE for the database.
    There are so many customization options available but one thing many users missing is that " How to change Font Size of Object Explorer?"
    Can you please accumulate this feature in IDE ASAP?
    Many Thanks,
    Bhavesh

    Its there
    Go to Tools -> Options
    Then under Environment you've fonts and colors tab where you can specify a higher font size.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to change font size

    Just purchased Deskjet 1010 & don't know how to change font size.

    hellinger
    Welcome to the HP Community Forum.
    In most cases you can adjust the scale of your documents before you print.
    Please take a look at the following:
    Manage Print Output with Print Preview
    Click the Kudos Thumbs-Up to say Thank You!
    And...Click Accept as Solution when my Answer provides a Fix or Workaround!
    I am pleased to provide assistance on behalf of HP. I do not work for HP. 
    Kind Regards,
    Dragon-Fur

  • How to boldface the header for ONE column

    hi,
    I want to know how to boldface the header for ONE column. The following will boldface the header for all the columns in the table
    table.getTableHeader().setFont(new java.awt.Font("Dialog", 1, 12));
    Thanks.
    Jrabi

    jtable.getColumnModel().getColumn( indexOfBoldColumn ).setHeaderRenderer( TableCellRenderer aRenderer )

  • Create an object for just one column in resultset?

    Does it make sense to return a result set of one column into an object that represents that table? It seems like a waste of memory, but maybe I am missing something. Also all generic DOA's I have found don't deal with this situation, so maybe someone can help me with how I think about this problem in my design. Thanks for the thoughts.

    >
    Plan B is to just return a list of Strings instead of a list of "some object". The issue with this is the ease of creating a generic DAO that is easy to program to. Having a DAO for each "table" class seems to be the best practice that is offered out there.
    >
    Well a String IS an object.
    From an architecture perspective you should model a table as a table. So if you have a table of one column you should still model it as a table. A table is a table is a table and you should generally treat it as such until or unless there is a compelling reason not to.
    If you step back from the 'implementation' and refocus on the 'design' and requirements one of those requirements is to identify the sources of data that your application needs. Sounds like that data, at the server level is in a table and the typical interface between an application and a database is via tables. Makes no difference if you need one row or 1000, one column or 30 columns the first focus is on the data source.
    So the interface between an application, in your case a Java app, and a database server will generally involved tables. That means you should probably still use a standard DAO (I assume you mean Data Access Object).
    A generic table DAO would typically have functionality to deal with tables and not just an arbitrary object. It would have getters and setters, functionality to support multiple rows and might even know about columns.
    In good data models tables almost never have just one column. Even a simple lookup table usually has an ID or CODE column and then a value column for the actual data. So if that one column table suddenly becomes two or more columns you will have to refactor your entire architecture to then use a standard DAO.
    That is why the statement you made is true.
    >
    Having a DAO for each "table" class seems to be the best practice that is offered out there.
    >
    Unless you have some real reason not to I suggest you stick with that practice. That will make you code more scaleable and more consistent.
    From an architecture perspective.

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • HT204053 I have 2 Apple ID's how do I delete 1 of them? Or how can I make them just one?

    I have 2 Apple ID's how do I delete 1 of them? Or how can I make them just one?

    To add to the above...
    From Here   http://support.apple.com/kb/HE37
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.

  • How to change font size on screen

    how to change font size on screen

    I'm not certain what font sizes you wish to change, when on a page you can use command and the += button to zoom in and make the fonts larger. On the finder desktop you can make what ever is on the desktop larger or smaller from the finder menu click view, custom view options, and adjust the icon size with the slider on the top, and the text using the text size box to select the size that your comfortable with.
    Forgot to add these.
    http://support.apple.com/kb/PH10876
    http://support.apple.com/kb/PH10877
    Hope this helps.

  • How to change font size and style in keynote for ios

    How to change font size and style in keynote for ios

    Same situation for report parameter input value font. What ever we do , it is still Arial and size 10.

  • How to change font size in a call-out tool box?

    Hi, the other day i inserted a call-out tool box in a PDF document, however i cannot find anything that can change the font size of the letters i input in that box. could anyone help? Thanks.
    Sherman

    This is a question for the Acrobat support forums – please post there.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Wed, 23 Nov 2011 10:55:07 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: how to change font size in a call-out tool box?
    Re: how to change font size in a call-out tool box?
    created by danmarch<http://forums.adobe.com/people/danmarch> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4043425#4043425

  • How to change font size in check printing program in AP Invoice

    I would like to know how to change font size in check printing program in Oracle Payables Module for Invoice printing. We are using Oracle standard
    report to print check.
    Concurrent program short name : APXPBFEL
    Prt file : APLASP.prt
    I modified prt file for code 199 like below
    code "199" esc "(8U" esc "(s0p12.00h10.00v0s0b3T" esc "&k11.75H"
    Font size changed for last page only which prints checks, for Void pages its printed with default font. For Page 1 printed with default font and page 2 has reduced font. This change is not intiallized for all pages.
    Please let me know if you any of you know how to change fonts.
    Thanks,
    Anand

    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/

Maybe you are looking for