How to set the row height in a JTable

Is there a way to set the height of a row (actually all rows) in a JTable?
I have tried setting the font to be bigger but then the cells are not big enough.

Use "rowHeight" method of JTable class.
For more information about JTable class, please read the API documentation at http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTable.html
/Sreenivasa Kumar Majji.
Is there a way to set the height of a row (actually
all rows) in a JTable?
I have tried setting the font to be bigger but then
the cells are not big enough.

Similar Messages

  • How to set the row height for a list control in flex 4.5 for mobile?

    Hi,
      I have a List in my Adobe Flash Builder 4.5 and flex 4.5 mobile application. I show the image and the label in my list. The list item height gets adjusted based on the image height. I don't want this auto row adjustment. Instead I would like to set the row height manually.
    Is there any property to set the item height in a list?

    setting rowHeight in the List layout works for me.
    <s:List>
    <s:layout>
    <s:VerticalLayout rowHeight="48"/>
    </s:layout>
    </s:List>

  • How to increase the row height of the table in the smartform

    Hi,
    Can any one say,
    How to increase the row height of the table in the smartform.
    It is presently show the row width very small, i want to increase the row with of the table in the smartform.
    Plase say how can we increase the row height in the smartform.

    Hi Ravi,
         In Smartforms , Select the Table and you can adjust the cell hieghts in OUTPUT OPTIONs TAB.
        Reward points if that Helps.
    Manish

  • How to decrease the row height in ALV Grid (OOPS).

    HI Experts,
    I have displayed ALV Grid using CL_GUI_ALV_GRID=>SET_TABLE_FOR_DISPLAY.
    I want to decrease the row height and width.
    Can any one suggest how to do this?
    Regards,
    Kumar.

    Hi Kumar,
    Row height it predefined and you won't change it, but you can adjust column width.
    For that use field COL_OPT of layout structure ( type LVC_SLAYO ) to optimize all columns width, or set explicit width using field catalog, setting field OUTPUTLEN for certain column.
    Regards
    Marcin

  • How to reduce the row height

    Hi All,
    Is it possible to reduce the row height of a table.Actually the font is small and the row height is more.I dont want to redcuse the width only row height.
    Regards,
    Amrit

    does anyone of u havea ny idea on how to achiieve this.

  • How to set the rows of dataTable using loadBundle tag?

    Hi,
    Can i set the rows property of a <h:dataTable> using the value from a <f:loadBundle> tag?
    I tried the following code
    <f:loadBundle basename="com.message.NumberOfRows" var="numRows"/>
    I have NumberOfRows.properties file with the following entry
    rows=5
    The dataTable code
    <h:dataTable value="#{mastData.list}" rows="#{numRows.rows}" align="center" var="mastBean">
    </h:dataTable>
    This code is generating ClassCast Exception.
    Please comment on this issue.
    Thanks,
    Renju

    Hi,
    Exactly Reymond, See Renju you already using mastData bean for datatable. In that create a bean method something like rows & create a getter/setter method returning int. In getter method try this code as
    ResourceBundle bundle = ResourceBundle.getBundle("ur resource bundle");
    rows = Integer.parseInt(bundle.getString("rows_to_display"));
    return rows.
    Hope you can now get some clear idea i guess
    Regards,
    A.

  • HELP Friends!!! How to set the width of columns of JTABLE?

    Hi!
    How to set the width of a particular column in JTable?
    I tried using headerRenderers and though I'm able to set the color and font of the header (using getTableCellRendererComponent method)I can't change the size.
    Pls some one help me..it's very urgent.
    Thanks in advance.
    Regards,
    Naval

    JTable.getColumnModel().getColumn(i).setWidth(width). There are also setPreferredWidth, setMaxWidth and setMinWidth methods.

  • TABLE - How to set the row in the table

    I have a problem where I have a selection on one view and then call a second view to display the results in a table. The table displays 5 rows. I then go down to the 20th row and select the row. When I have finished processing, I still have row 20 selected and I go back via a plug to the selection screen. I then enter new criteria and go back to the second view and the table displays that data showing row 20 as the first row. How do I get it to go back to row 1 every time I go into the second view??

    Hello Graeme,
    assuming i understand the problem, as a quick solution it would perhaps help to set the lifetime of the second view from "framework controlled" to "when visible" (in the properties of the view). Another way could be to explictly invalidate the context node holding the data for the second view after having left the view.
    Kind regards
    Andreas

  • Re: How to set the line height of a Label?

    In Java 8, set the graphic of the label to a TextFlow with line spacing set.
    Text text = new Text("This is my\nspaced text.");
    TextFlow flow = new TextFlow(text);
    flow.setLineSpacing(13); // default font size is 13px, so this effectively makes the text double spaced, e.g. one line of text, one blank line, another line of text, another blank line, etc.
    Label label = new Label();
    label.setGraphic(flow);
    For Java 7, I don't know how you would set line spacing for a label.

    In Java 8 you can do it even more simply:
    Label label = new Label("This is my\nspaced text");
    label.setLineSpacing(13);
    The line spacing property can also be set with css:
    .label {
    -fx-line-spacing: 13;
    Of course, none of that actually helps to do this in Java 7. If you're not wrapping the text, you can fairly easily split the text at new lines, and add a label for each line to a VBox, specifying the spacing for the VBox as required.
    If you're wrapping text, trying something similar gets ugly rather quickly.

  • How to set the variable height for TileLayout

    Hi,
    I am using TileLayout in  <s:List> component . TileLayout takes the maximum height of the children and draw the same height for rest of the children in all rows. Instead, I want to have all the rows with various heights if their children have different heights.
    I know there is variable height property in <mx:List> component but which is not there in its spark counterpart. Can you please help me with this issue??
    Thanks,
    Bhoja

    The spark TileLayout class lays out all of its elements in equally sized "cells".  Cells of variable sizes is not currently supported.

  • How to fix the row-height in excel using ole2

    hi
    I want to fix row height in excel using ole2.
    i wrote the below code but no effect. please help me.
    Arg := ole2.create_arglist;
         ole2.add_arg(Arg,1);
         rrow := ole2.get_obj_property(WorkSheet,'Rows',Arg);
         ole2.destroy_arglist(arg);
         ole2.set_property(rrow,'Height',50);
    kanish

    It's solved
         ole2.set_property(rrow,'RowHeight',30);
    kanish

  • How to set the border of header of JTable

    I am using the following code to set the border of my JTable headers but it doesn't seem to work!! The headers do get CENTER aligned but somehow they do not show the right border. Please Help.
    class cellAlignRenderer extends DefaultTableCellRenderer
    cellAlignRenderer()
    setHorizontalAlignment(JLabel.CENTER);
    Border b = BorderFactory.createEtchedBorder() ;
    setBorder(b);
    jTable.getColumn(0).setHeaderRenderer( new cellAlignRenderer());

    try this
    public class YourTableHeaderRenderer extends DefaultTableCellRenderer
    public YourTableHeaderRenderer()
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column)
    JLabel comp = (JLabel) super.getTableCellRendererComponent(table,value,
    isSelected,hasFocus,row,column);
    try
    comp.setBorder(BorderFactory.createBevelBorder(0,Color.lightGray,Color.darkGray));
    setFont(new java.awt.Font("Dialog", 0, 15));
    setHorizontalAlignment(SwingConstants.CENTER);
    catch(Exception err)
    err.printStackTrace();
    return this;

  • How can I set the row height in iCal

    Hi,
    I have a job that has odd hours, some at 0800 in the morning, some at 2100 at night. To keep track, I use iCal.
    On the monitor of my 13" MacBook, the iCal window only shows 11 or 12 hrs max of each day. I can zoom in or out, which makes the window bigger and smaller, higher and lower, but the iCal data adjust size with it. I can never see a whole day, i.e. 14 hours at once.
    How do I make iCal display more than 11.5 hours of the day?
    Axel

    I found the answer here: https://discussions.apple.com/message/16323733#16323733

  • JTable.setRowHeight(int row, int rowHeight) sets the row height to Zero

    TableModel1 model1 = new TableModel1();
    TableModel2 model2 = new TableModel2().
    JTable table = new JTable();
    I dynamically switch the model of the table by calling table.setModel(model1) or table.setModel(model2).
    Now, I have to show rows of variable heights in my table. But when I say table.setRowHeight(row, rowHeight), it is setting it the rowHeight to Zero. What is the problem? Does the fact that I am changing the tablemodels is causing any problem?
    Any help is really appreciated.
    Thanks in advance!

    OK, I found two fixes to this problem:
    1. upgrade to jdk1.4
    OR
    2. When table model data is changed, replace the calls to fireTableDataChanged() with appropriate combination of calls to fireTableRowsDeleted(), fireTableRowsInserted(), and fireTableRowsUpdated().
    I'm not sure if #2 will work for you since you're changing the table model entirely, but you might try #1. I got the ideas from bug 4398268. Good luck!

  • When I change the row heights in a spreadsheet, then save, close, and open it, the row heights are back to default. How can I prevent this?

    One of our reports has lots of text in some rows. I import the data, adjust the row width and ask the text to wrap, which automatically sets the row height appropriately. When I save, close, and open that spreadsheet, the width is still the same and Wrap is still selected, but the rows are only one line high, which means that the report is unreadable and a serious pain to make readable.
    I can save it as a PDF, but I'd rather be able to use the Numbers format or Excel and be confident that my recipients can read it.

    Hi k,
    I'm unable to reproduce the described behaviour.
    The document containing the table below has a combination of row heights set manually using teh stepper in the Table Inspector (both 0.76" labeled rows), set manually by dragging the row boundary between row reference tabs (labeled 1/13"), and set automatically by Numbers to fit the content of the remaining cells.
    Content in the rows with names beginning E, F, G or H wraps automatically to form two rows in the cell. The rest are forced into two lines using a carriage return character.
    All maiintained their row heights through two Saves and reopenings.
    Regards,
    Barry

Maybe you are looking for