JTable with custom column model and table model not showing table header

Hello,
I am creating a JTable with a custom table model and a custom column model. However the table header is not being displayed (yes, it is in a JScrollPane). I've shrunk the problem down into a single compileable example:
Thanks for your help.
import javax.swing.*;
import javax.swing.table.*;
public class Test1 extends JFrame
     public static void main(String args[])
          JTable table;
          TableColumnModel colModel=createTestColumnModel();
          TestTableModel tableModel=new TestTableModel();
          Test1 frame=new Test1();
          table=new JTable(tableModel, colModel);
          frame.getContentPane().add(new JScrollPane(table));
          frame.setSize(200,200);
          frame.setVisible(true);
     private static DefaultTableColumnModel createTestColumnModel()
          DefaultTableColumnModel columnModel=new DefaultTableColumnModel();
          columnModel.addColumn(new TableColumn(0));
          return columnModel;
     static class TestTableModel extends AbstractTableModel
          public int getColumnCount()
               return 1;
          public Class<?> getColumnClass(int columnIndex)
               return String.class;
          public String getColumnName(int column)
               return "col";
          public int getRowCount()
               return 1;
          public Object getValueAt(int row, int col)
               return "test";
          public void setValueAt(Object aValue, int rowIndex, int columnIndex)
}Edited by: 802416 on 14-Oct-2010 04:29
added                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

Kleopatra wrote:
jduprez wrote:
See http://download.oracle.com/javase/6/docs/api/javax/swing/table/TableColumn.html#setHeaderValue(java.lang.Object)
When the TableColumn is created, the default headerValue  is null
So, the header ends up rendered as an empty label (probably of size 0 if the JTable computes its header size based on the renderer's preferred size).nitpicking (can't resist - the alternative is a cleanup round in some not so nice code I produced recently <g>):
- it's not the JTable's business to compute its headers size (and it doesn't, the header's the culprit.) *> - the header should never come up with a zero (or near-to) height: even if there is no title shown, it's still needed as grab to resize/move the columns. So I would consider this sizing behaviour a bug.*
- furthermore, the "really zero" height is a longstanding issue with MetalBorder.TableHeaderBorder (other LAFs size with the top/bottom of their default header cell border) which extends AbstractBorder incorrectly. That's easy to do because AbstractBorder itself is badly implemented
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6459419
Thanks for the opportunity to have some fun :-)
JeanetteNo problem, thanks for the insight :)

Similar Messages

  • HT4972 I have an ipad with 4.10.01 and itunes does not show a software update?

    I have an ipad2 with 4.1 firmware.
    I cannot update it as my itunes on my mac recognize my ipad as a device to sync to.
    What else can I try?
    Thanks for any help!

    My guess is you have a very old version of iTunes on your Mac.
    Go to http://www.apple.com/itunes on your mac to download a more recent copy.
    Depending on how old your Mac is and how old its OS X is, you may not get too current an iTunes version.  The latest is 11.0.4.

  • Secure boot not working with MSI Z77a-G45 And system reserve not showing

    Ok so i re did my windows after i did a zero fill on my hard drive as it was showing a corrupted sector on my disk that seemed to fix it for now, until it comes back if it does crossing my fingers it gone for good. But now i can't seem to get Secure boot to work i mean i did not have it before as i just slapped the motherboard in with a existing windows, that was to be expected but this is a clean install of windows 8.1 and i even have secure boot on but its not working and reports as off in windows.  Is it because i have my bios set to legacy+UEFI??? would that make secure boot not work??. i even went as far as turning it off and back on again the secure boot setting nothing made a difference.  I mean its not a big deal bit would be nice to know why its not working, also another wired thing and i will post pictures of it, as i cant see my system reserved partition in disk management but diskpart says it there, i will post those pictures any ideas??. 

    fixed it is my legacy+uefi another forum got back to me.

  • Mail app not working with iCloud, new emails and recently sent not showing at all in the app.

    I've been using the iCloud mail for quite some time now

    A lot of people have been unable to access Yahoo e-mail on their iPhones or iPads. My wife’s iPad was not downloading Yahoo mail, although her iPhone was. Both used IOS 8.2. We tried deleting the account several times and troubleshooting all of the other settings. The problem appears to have been that allowing the IOS to automatically create the account on the iPad resulted in the wrong settings for the incoming server. The following procedure, pieced together from two websites, fixed the problem for us. So far, so good.
    https://portal.smartertools.com/kb/a2659/configure-imap-for-iphone-or-ipad.aspx
    https://help.yahoo.com/kb/mobile-mail/imap-server-settings-sln4075.html
    On the iPhone, tap Settings.
    Tap Mail, Contacts, Calendars.
    Tap your Yahoo account, then delete it.
    Tap Add Account.
    Tap Other.
    Tap Add Mail Account.
    Complete the Name, Address (email address), Password and Description fields.
    Click Next.
    Ensure IMAP is selected.
    Enter the following incoming mail server information:
    Incoming Mail (IMAP) Server - Requires SSL
    Server: imap.mail.yahoo.com
    Port: 993
    Requires SSL: Yes
    Hostname is mail.yahoo.com.
    Username is your full email address
    Password is the same password used to access webmail.
    Enter the following outgoing mail server information:
    Outgoing Mail (SMTP) Server - Requires SSL
    Server: smtp.mail.yahoo.com
    Port: 465 or 587
    Requires SSL: Yes
    Requires authentication: Yes
    Username is your full email address
    Password is the same password used to access webmail. It may have been entered for you.
    Tap Next.
    The iPhone will establish an SSL connection to your IMAP and SMTP servers.
    That’s all!

  • JButton in JTable with custom table model

    Hi!
    I want to include a JButton into a field of a JTable. I do not know why Java does not provide a standard renderer for JButton like it does for JCheckBox, JComboBox and JTextField. I found some previous postings on how to implement custom CellRenderer and CellEditor in order to be able to integrate a button into the table. In my case I am also using a custom table model and I was not able to create a clickable button with any of the resources that I have found. The most comprehensive resource that I have found is this one: http://www.java2s.com/Code/Java/Swing-Components/ButtonTableExample.htm.
    It works fine (rendering and clicking) when I start it. However, as soon as I incorporate it into my code, the clicking does not work anymore (but the buttons are displayed). If I then use a DefaultTableModel instead of my custom one, rendering and clicking works again. Does anyone know how to deal with this issue? Or does anyone have a good pointer to a resource for including buttons into tables? Or does anyone have a pointer to a resource that explains how CellRenderer and CellEditor work and which methods have to be overwritten in order to trigger certain actions (like a button click)?
    thanks

    Yes, you were right, the TableModel was causing the trouble, everything else worked fine. Somehow I had this code (probably copy and pasted from a tutorial - damn copy and pasting) in my TableModel:
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 3) {
                    return false;
                } else {
                    return true;
    }A pretty stupid thing when you want to edit the 3rd column...

  • JTable Problem (table does not show rows and columns)

    Hi All,
    What the table is suppose to do.
    - Load information from a database
    - put all the values in the first column
    - in the second column put combobox (cell editor with numbers 1-12)
    - the 3rd column put another combobox for something else
    - the 4th column uses checkbox as an edit
    The number of rows of the table should be equal to the number of
    record from
    the database. If not given it default to 20 (poor but ok for this)
    The number of columns is 4.
    But the table does not show any rows or
    column when I put it inside a
    JScrollPane (Otherwise it works).
    Please help,
    thanks in advance.
    public class SubjectTable extends JTable {
    * Comment for <code>serialVersionUID</code>
    private static final long serialVersionUID = 1L;
    /** combo for the list of classes */
    protected JComboBox classCombo;
    /** combo for the list of subjects */
    protected JComboBox subjectsCombo;
    /** combo for the list of grade */
    protected JComboBox gradeCombo;
    boolean canResize = false;
    boolean canReorder = false;
    boolean canSelectRow = false;
    boolean canSelectCell = true;
    boolean canSelectColumn = true;
    // the row height of the table
    int rowHeight = 22;
    // the height of the table
    int height = 200;
    // the width of the table
    int width = 300;
    // the size of the table
    Dimension size;
    * Parameterless constructor. Class the one of the other constructors
    to
    * create a table with the a new <code>SubjectTableModel</code>.
    public SubjectTable() {
    this(new SubjectTableModel());
    * Copy constructor to create the table with the given
    * <code>SubjectTableModel</code>
    * @param tableModel -
    * the <code>SubjectTableModel</code> with which to
    initialise
    * the table.
    SubjectTable(SubjectTableModel tableModel) {
    setModel(tableModel);
    setupTable();
    * Function to setup the table's functionality
    private void setupTable() {
    clear();
    // set the row hieght
    this.setRowHeight(this.rowHeight);
    // set the font size to 12
    //TODO this.setFont(Settings.getDefaultFont());
    // disble reordering of columns
    this.getTableHeader().setReorderingAllowed(this.canReorder);
    // disble resing of columns
    this.getTableHeader().setResizingAllowed(this.canResize);
    // enable the horizontal scrollbar
    this.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    // disable row selection
    setRowSelectionAllowed(this.canSelectRow);
    // disable column selection
    setColumnSelectionAllowed(this.canSelectColumn);
    // enable cell selection
    setCellSelectionEnabled(this.canSelectCell);
    setPreferredScrollableViewportSize(getSize());
    TableColumn columns = null;
    int cols = getColumnCount();
    for (int col = 0; col < cols; col++) {
    columns = getColumnModel().getColumn(col);
    switch (col) {
    case 0:// subject name column
    columns.setPreferredWidth(130);
    break;
    case 1:// grade column
    columns.setPreferredWidth(60);
    break;
    case 2:// class room column
    columns.setPreferredWidth(120);
    break;
    case 3:// select column
    columns.setPreferredWidth(65);
    break;
    } // end switch
    }// end for
    // set up the cell editors
    doGradeColumn();
    doClassColumn();
    //doSubjectColumn();
    * Function to clear the table selection. This selection is different
    to
    * <code>javax.swing.JTable#clearSelection()</code>. It clears the
    user
    * input
    public void clear() {
    for (int row = 0; row < getRowCount(); row++) {
    for (int col = 0; col < getColumnCount(); col++) {
    if (getColumnName(getColumnCount() - 1).equals("Select")) {
    setValueAt(new Boolean(false), row, getColumnCount() - 1);
    }// if
    }// for col
    }// for row
    * Function to set the cell renderer for the subjects column. It uses
    a
    * combobox as a cell editor in the teacher's subjects table.
    public void doSubjectColumn() {
    TableColumn nameColumn = getColumnModel().getColumn(0);
    nameColumn.setCellEditor(new DefaultCellEditor(getSubjectsCombo()));
    // set up the celll renderer
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for drop down list");
    nameColumn.setCellRenderer(renderer);
    // Set up tool tip for the sport column header.
    TableCellRenderer headerRenderer = nameColumn.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer) {
    ((DefaultTableCellRenderer) headerRenderer)
    .setToolTipText("Click the Name to see a list of choices");
    }// end doSubjectsColumn----------------------------------------------
    /** Function to set up the grade combo box. */
    public void doGradeColumn() {
    TableColumn gradeColumn = getColumnModel().getColumn(1);
    gradeColumn.setCellEditor(new DefaultCellEditor(getGradeCombo()));
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for drop down list");
    gradeColumn.setCellRenderer(renderer);
    // Set up tool tip for the sport column header.
    TableCellRenderer headerRenderer = gradeColumn.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer) {
    ((DefaultTableCellRenderer) headerRenderer)
    .setToolTipText("Click the Grade to see a list of choices");
    }// end doGradeColumn-------------------------------------------------
    * Function to setup the Class room Column of the subjects
    public void doClassColumn() {
    // set the column for the classroom
    TableColumn classColumn = getColumnModel().getColumn(2);
    classColumn.setCellEditor(new DefaultCellEditor(getClassCombo()));
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for drop down list");
    classColumn.setCellRenderer(renderer);
    // Set up tool tip for the sport column header.
    TableCellRenderer headerRenderer = classColumn.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer) {
    ((DefaultTableCellRenderer) headerRenderer)
    .setToolTipText("Click the Class to see a list of choices");
    }// end doClassColumn--------------------------------------------------
    * Function to get the size of the table
    * @return Returns the size.
    public Dimension getSize() {
    if (this.size == null) {
    this.size = new Dimension(this.height, this.width);
    return this.size;
    * Function to set the size of the table
    * @param dim
    * The size to set.
    public void setSize(Dimension dim) {
    if (dim != null) {
    this.size = dim;
    return;
    * Function to create/setup the class room comboBox. If the comboBox
    is
    * <code>null</code> a nwew one is created else the functon returns
    the
    * function that was returned initially.
    * @return Returns the classCombo.
    private JComboBox getClassCombo() {
    if (this.classCombo == null) {
    this.classCombo = new JComboBox();
    // fill up the class name combo
    ArrayList classRooms = new ArrayList();
    try {
    //TODO classRooms = Settings.getDatabase().getClassRooms();
    for (int i = 0; i < 10; i++) {
    String string = new String("Class");
    string += i;
    if (!classRooms.isEmpty()) {
    classRooms.trimToSize();
    for (int i = 0; i < classRooms.size(); i++) {
    this.classCombo.addItem(classRooms.get(i));
    } catch (Exception e) {
    e.printStackTrace();
    return this.classCombo;
    * Function to create/setup the subjects comboBox. If the comboBox is
    * <code>null</code> a nwew one is created else the functon returns
    the
    * function that was returned initially.
    * @return Returns the subjectsCombo.
    private JComboBox getSubjectsCombo() {
    if (this.subjectsCombo == null) {
    this.subjectsCombo = new JComboBox();
    try {
    ArrayList subjects = loadSubjectsFromDatabase();
    if (!subjects.isEmpty()) {
    Iterator iterator = subjects.iterator();
    while (iterator.hasNext()) {
    // create a new subject instance
    //TODO Subject subct = new Subject();
    // typecast to subject
    //TODO subct = (Subject) iterator.next();
    String name = (String) iterator.next();
    // add this subject to the comboBox
    //TODO this.subjectsCombo.addItem(subct.getName());
    subjectsCombo.addItem(name);
    }// end while
    }// end if
    else {
    JOptionPane.showMessageDialog(SubjectTable.this,
    "Subjects List Could Not Be Filled");
    System.out.println("Subjects List Could Not Be Filled");
    } catch (Exception e) {
    e.printStackTrace();
    return this.subjectsCombo;
    * Function to load subjects from the <code>Database</code>
    * @return Returns the subjects.
    private ArrayList loadSubjectsFromDatabase() {
    // list of all the subject that the school does
    ArrayList subjects = new ArrayList();
    try {
    //TODO to be removed later on
    for (int i = 0; i < 10; i++) {
    String string = new String("Subject");
    string += i;
    subjects.add(i, string);
    // set the school subjects
    //TODO subjects = Settings.getDatabase().loadAllSubjects();
    } catch (Exception e1) {
    e1.printStackTrace();
    return subjects;
    * Function to create/setup the grade comboBox. If the comboBox is
    * <code>null</code> a nwew one is created else the functon returns
    the
    * function that was returned initially.
    * @return Returns the gradeCombo.
    private JComboBox getGradeCombo() {
    if (this.gradeCombo == null) {
    this.gradeCombo = new JComboBox();
    // fill with grade 1 to 12
    for (int i = 12; i > 0; i--) {
    this.gradeCombo.addItem(new Integer(i).toString());
    return this.gradeCombo;
    public static void main(String[] args) {
    try {
    UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
    System.out.println("Look and Feel has been set");
    } catch (UnsupportedLookAndFeelException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    SubjectTableModel model = new SubjectTableModel();
    int cols = model.getColumnCount();
    int rows = model.getRowCount();
    Object[][] subjects = new Object[rows][cols];
    for (int row = 0; row < rows; row++) {
    subjects[row][0] = new String("Subjectv ") + row;
    }//for
    model.setSubjectsList(subjects);
    SubjectTable ttest = new SubjectTable(model);
    JFrame frame = new JFrame("::Table Example");
    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setViewportView(ttest);
    frame.getContentPane().add(scrollPane);
    frame.pack();
    frame.setVisible(true);
    **************************************END
    TABLE******************************
    ----------------------------THE TABLE
    MODEL----------------------------------
    * Created on 2005/03/21
    * SubjectTableModel
    package com.school.academic.ui;
    import javax.swing.table.AbstractTableModel;
    * Class extending the <code>AbstractTableModel</code> for use in
    creating the
    * <code>Subject</code>s table. In addition to the implemented methods
    of
    * <code>AbstractTableModel</code> The class creates a model that has
    initial
    * values - the values have their own <code>getter</code> and
    * <code>setter</code> methods - but can still be used for values that
    a user
    * chooses.
    * <p>
    * @author Khusta
    public class SubjectTableModel extends AbstractTableModel {
    * Comment for <code>serialVersionUID</code>
    private static final long serialVersionUID = 3257850978324461113L;
    /** Column names for the subjects table */
    String[] columnNames = { "Subject", "Grade", "Class Room",
    "Select" };
    /** Array of objects for the subjects table */
    Object[][] subjectsList;
    private int totalRows = 20;
    protected int notEditable = 0;
    * Parameterless constructor.
    public SubjectTableModel() {
    // TODO initialise the list
    // add column to the default table model
    this.subjectsList = new
    Object[getTotalRows()][getColumnNames().length];
    * Copy constructor with the <code>subjectList</code> to set
    * @param subjects
    public SubjectTableModel(Object[][] subjects) {
    this(0, null, subjects, 0);
    * Copy constructor with the initial number of row for the model
    * @param rows -
    * the initial rows of the model
    * @param cols -
    * the initial columns of the model
    * @param subjects -
    * the initial subjects for the model
    * @param edit - the minimum number of columns that must be
    uneditable
    public SubjectTableModel(int rows, String[] cols, Object[][]
    subjects, int edit) {
    // set the initial rows
    setTotalRows(rows);
    // set the column names
    setColumnNames(cols);
    // set the subjectlist
    setSubjectsList(subjects);
    //set not editable index
    setNotEditable(edit);
    * Function to get the total number of columns in the table
    * @return int -- the columns in the table
    public int getColumnCount() {
    if (this.subjectsList == null) {
    return 0;
    return getColumnNames().length;
    * Function to get the total number of rows in the table
    * @return int -- the rows in the table
    public int getRowCount() {
    if (this.subjectsList == null) {
    return 0;
    return this.subjectsList.length;
    * Function to get the name of a column in the table.
    * @param col --
    * the column to be named
    * @return String -- the column in the table
    public String getColumnName(int col) {
    if (getColumnNames()[col] != null) {
    return getColumnNames()[col];
    return new String("...");
    * Function to get the value of the given row.
    * @param row --
    * the row of the object.
    * @param col --
    * the col of the object.
    * @return Object -- the value at row, col.
    public Object getValueAt(int row, int col) {
    return getSubjectsList()[row][col];
    * Function to return the data type of the given column.
    * @param c --
    * the column whose type must be determined.
    * @return Class -- the type of the object in this col.
    public Class getColumnClass(int c) {
    if (getValueAt(0, c) != null) {
    return getValueAt(0, c).getClass();
    return new String().getClass();
    * Function to put a value into a table cell.
    * @param value --
    * the object that will be put.
    * @param row --
    * the row that the object will be put.
    * @param col --
    * the col that the object will be put.
    public void setValueAt(Object value, int row, int col) {
    * TODO: Have a boolean value to determine whether to clear or
    to set.
    * if true clear else set.
    if (value != null) {
    if (getSubjectsList()[0][col] instanceof Integer
    && !(value instanceof Integer)) {
    try {
    getSubjectsList()[row][col] = new
    Integer(value.toString());
    fireTableCellUpdated(row, col);
    } catch (NumberFormatException e) {
    * JOptionPane .showMessageDialog( this., "The \""
    +
    * getColumnName(col) + "\" column accepts only
    values
    * between 1 - 12");
    return;
    System.out.println("Value = " + value.toString());
    System.out.println("Column = " + col + " Row = " + row);
    // column = Grade or column = Select
    switch (col) {
    case 2:
    try {
    // TODO
    if (Boolean.getBoolean(value.toString()) == false
    && getValueAt(row, 0) != null
    && getValueAt(row, 1) != null
    && getValueAt(row, 2) != null) {
    // subjectsList[row][col + 1] = new
    Boolean(true);
    System.out.println("2. false - Updated...");
    * this.subjectListModel.add(row,
    * this.subjectsList[row][0] + new String(" -
    ") +
    * this.subjectsList[row][2]);
    } catch (ArrayIndexOutOfBoundsException exception) {
    exception.printStackTrace();
    break;
    case 3:
    if (Boolean.getBoolean(value.toString()) == false
    && getValueAt(row, 0) != null
    && getValueAt(row, 1) != null
    && getValueAt(row, 2) != null) {
    System.out.println("3. If - Added...");
    getSubjectsList()[row][3] = new Boolean(true);
    this.subjectListModel.addElement(this.subjectsList[row][0] +
    * new String(" - ") + this.subjectsList[row][2]);
    // subjectListModel.remove(row);
    fireTableCellUpdated(row, col);
    fireTableDataChanged();
    // this.doDeleteSubject();
    } else if (Boolean.getBoolean(value.toString()) ==
    true
    && getValueAt(row, 0) != null
    && getValueAt(row, 1) != null
    && getValueAt(row, 2) != null) {
    setValueAt("", row, col - 1);
    setValueAt("", row, col - 2);
    setValueAt("", row, col - 3);
    System.out.println("3. Else - Cleared...");
    // this.subjectListModel.remove(row);
    break;
    default:
    break;
    }// end switch
    getSubjectsList()[row][col] = value;
    fireTableCellUpdated(row, col);
    fireTableDataChanged();
    }// end if
    }// end
    * Function to enable edition for all the columns in the table
    * @param row --
    * the row that must be enabled.
    * @param col --
    * the col that must be enabled.
    * @return boolean -- indicate whether this cell is editble or
    not.
    public boolean isCellEditable(int row, int col) {
    if (row >= 0
    && (col >= 0 && col <= getNotEditable())) {
    return false;
    return true;
    * Function to get the column names for the model
    * @return Returns the columnNames.
    public String[] getColumnNames() {
    return this.columnNames;
    * Function to set the column names for the model
    * @param cols
    * The columnNames to set.
    public void setColumnNames(String[] cols) {
    // if the column names are null the default columns are used
    if (cols != null) {
    this.columnNames = cols;
    * Function to get the rows of subjects for the model
    * @return Returns the subjectsList.
    public Object[][] getSubjectsList() {
    if (this.subjectsList == null) {
    this.subjectsList = new
    Object[getTotalRows()][getColumnNames().length];
    return this.subjectsList;
    * Function to set the subjects list for the model
    * @param subjects
    * The subjectsList to set.
    public void setSubjectsList(Object[][] subjects) {
    // if the subject list is null create a new one
    // using default values
    if (subjects == null) {
    this.subjectsList = new
    Object[getTotalRows()][getColumnNames().length];
    return;
    this.subjectsList = subjects;
    * Function to get the total number of rows for the model. <b>NB:
    </b> This
    * is different to <code>
    getRowCount()</code>.<code>totalRows</code>
    * is the initial amount of rows that the model must have before
    data can be
    * added.
    * @return Returns the totalRows.
    * @see #setTotalRows(int)
    public int getTotalRows() {
    return this.totalRows;
    * Function to set the total rows for the model.
    * @param rows
    * The totalRows to set.
    * @see #getTotalRows()
    public void setTotalRows(int rows) {
    // if the rows are less than 0 the defaultRows are used
    // set getTotalRows
    if (rows > 0) {
    this.totalRows = rows;
    * Function to get the number of columns that is not editble
    * @return Returns the notEditable.
    public int getNotEditable() {
    return this.notEditable;
    * Function to set the number of columns that is not editable
    * @param notEdit The notEditable to set.
    public void setNotEditable(int notEdit) {
    if (notEdit < 0) {
    notEdit = 0;
    this.notEditable = notEdit;
    ----------------------------END TABLE MODEL----------------------------------

    I hope you don't expect us to read hundreds of lines of unformatted code? Use the "formatting tags" when you post.
    Why are you creating your own TableModel? It looks to me like the DefaultTableModel will store you data. Learn how to use JTable with its DefaultTableModel first. Then if you determine that DefaultTableModel doesn't provide the required functionality you can write your own model.

  • How to print jTable with custom header and footer....

    Hello all,
    I'm trying to print a jTable with custom header and footer.But
    jTable1.print(PrintMode,headerFormat,footerFormat,showPrintDialog,attr,interactive)
    does not allow multi line header and footer. I read in a chat that we can make custom header and footer and wrap the printable with that of the jTable. How can we do that..
    Here's the instruction on the chat...
    Shannon Hickey: While the default Header and Footer support in the JTable printing won't do exactly what you're looking for, there is a straight-forward approach. You can turn off the default header/footer and then wrap JTable's printable inside another Printable. This wrapper printable would then render your custom data, and then adjust the size given to the wrapped printable
    But how can i wrap the jTable's Printable with the custom header and footer.
    Thanks in advance,

    I also once hoped for an easy way to modify a table's header and footer, but found no way.
    Yet it is possible.

  • I got a Model Number: A1181, My hard drive burned out. I bouhgt a new hard drive Wd Scorpio 500 GB. When i tried to install the MAC OS, it identies a hard drive with 3.6 TB and i'm not able to do the installation.

    I got a Model Number: A1181, My hard drive burned out. I bouhgt a new hard drive Wd Blue Scorpio 500 GB. When i tried to install the MAC OS, it identifies a hard drive with 3.6 TB and i'm not able to do the installation. I touhgt the new ard drive was bad but i was able to install windows XP. Any ideas what do i have to do?

    Well, let's hope that nothing was jiggled out of place when you were installing the new hard drive. Your optical drive may just be out of alignment or the disc you have is "dirty." Get a lint-free cloth and some rubbing alcohol, then clean the disc as thoroughly as you can starting from the center and working outward in a concentric circlular motion. See if that helps. In particular clean the inner portion well.
    If this does not help, then you have a problem. You have opened the computer yourself. That action voids all support from Apple. If you take the computer in for service the store may refuse to service the computer. This is not related to your now expired warranty.

  • Installed my Photoshop Elements 7 on my new laptop.  Says my serial number is invalid.  Chatted with customer service rep and she says the number should work. What now?

    Installed my Photoshop Elements 7 on my new laptop.  Says my serial number is invalid.  Chatted with customer service rep and she says the number should work. What now?

    Hi,
    Did the serial number come from a boxed set and previously installed from disc and are you now trying to install from a download?
    If so, that will not work - the serial numbers are different.
    If you don't have a dvd drive on your new system, perhaps you could get someone to copy your disc to a memory stick and install from that.
    Brian

  • Where is Captured Models and Converted Models in SD 3.0.03?

    Hi,
    I was using OSD 2.1 and was using captured Models and Converted Models view to migrate my SQL Server database objects. I can not find it in new version of OSD 3.0.03.
    Is there any flow change in this release? Where can I find these two views?
    Also I can not find right click menu item "Capture Function" if I want to migrate SQL Server function to Oracle.
    I appreciate your input/help.
    Thanks,
    Edited by: Jignesh Parikh on May 18, 2011 4:25 AM

    Jignesh,
    Have you tried any migration steps at all using the v3 version ?
    You can start a migration by either -
    - click on Tools then the Migration option
    - make a connection to SQL*Server, exapnd the entry then right click on a database which brings up the migration option.
    The workflow is different from the v2.1 version and once going through the migration steps you can stop at any stage you want, for example at the capture stage without doing the convert.
    You should checkout the documentation available at -
    http://www.oracle.com/technetwork/developer-tools/sql-developer/documentation/index.html
    Regards,
    Mike

  • Can we add a new column in report which is not in table.

    Hi All,
    Can we create a new column in report which is not in table.
    I have two columns in my table completion_date, manufacture_date. If the difference between the completion_date and manufacture_date is 0, -1, 1 then the new column of the report will say on time against each record or else will display late. Any suggestion how to proceed on this
    Regards
    Edited by: User_Apex on May 16, 2011 5:54 AM

    Standard report then, NOT an interactive report (which if you were using, you could build a computation and report on that)..
    Then the adding a column in the query would be your best best...
    Thank you,
    Tony Miller
    Webster, TX
    There are two kinds of pedestrians -- the quick and the dead.
    If this question is answered, please mark the thread as closed and assign points where earned..

  • I have an iphone 4 with the latest updates, but icloud does not show store option. My pics and music are not on the cloud, how do I upload them from my phone to the cloud? I just paid $20 thinking i needed more storage, but that did nothing. help

    I have an Iphone 4 with OS 5.1.1 and it does not show store or music under my icloud tab in the phone. Also, my music and photos don't show on my icloud?
    My contacts show and find my iphone....on the icloud. I just paid $20 thinking more storage would help, but it didn't. How can i cancel that and get a refund?
    Where are is my music on the cloud? How do I upload my music to it? If I lose my phone, it looks like there is no where to go to retrieve my music.
    And itunes won't let me sync my music to my computer. It is all music that I've purchased on itunes.
    Thanks!

    You need to subscribe to iTunes Match to store your music on iCloud:
    http://www.apple.com/itunes/itunes-match/
    To transfer iTunes Store purchases made on your phone to your computer, connect your phone then choose "Transfer purchases..." from the File menu in iTunes.
    Photostream transfers photos taken on your iOS devices to other devices and your computer. For troubleshooting Photostream see: http://support.apple.com/kb/TS3989

  • I have a Ipod touch and recently added new music to my itunes library on my laptop. When I sync with my ipod, the new music does not show up on my ipod even though the sync process seems to be working.

    I have an Ipod touch and recently added new music to my Itunes library. When I sync with the library, the new music does not show up on my ipod. The sync process seems to be working and there is still plenty of space on the Ipod for new music so I'm not sure what the problem is!

    What happens when you try to sync?
    Was the iPod previous synced to another iTunes library/computer?
    Have you successfully synced from this iTunes library/computer before?
    Do the songs play in iTunes?
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod        
    Do you have any Restrictions (Settings>General>Restrictions) set that would prevent syncing those songs?

  • When I attempt to connect to iCloud I get the error message: Apple id's email address cannot be verified.  There is nothing wrong with my apple id and I do not want to change it.Any suggestions?

    When I attempt to connect to iCloud I get the error message: Apple id's email address cannot be verified.  There is nothing wrong with my apple id and I do not want to change it.Any suggestions?

    Debi....
    Try "resetting" your Apple ID password >  Apple - My Apple

  • It says "this device is already associated with another apple ID" and it will not download previous purchases.

    It says "this device is already associated with another apple ID" and it will not download previous purchases. This is a new iPad 4 as my last iPad 4 was stolen. How can I fix this issue, can I fix this issue?

    Go to Settings > General > Reset > Reset and Erase all Content
    This returns the iPad to its original state then setup the iPad as new.

Maybe you are looking for

  • Running a Java Application on a Novell Netware Server

    I know this is a strange question but I was hopeing someone could help me or point me in the right direction. I have a java application that backs up files. I would like to run it automatically at night on our Novell server. Can Java run on a Novell

  • Performance rating.

    How to design and implement performance ratings of employees in ByD system. Any ideas. Anbas Edited by: on Feb 10, 2012 5:52 AM

  • Acrobat 9 email and Exchange directory

    When sending out PDFs for review throught Acrobat 9, acrobat is able to add individuals from the Exchange directory but not groups created in Exchange. For groups created in Outlook there is no problem, Acrobat opens the groups and allows all the ind

  • Configuring WLC and AP'S

    Hi all, some questions 1.Do I need to put an ip on the ap manager interface? 2.does the ap manager interface go on the same subnet at the access points? 3.Im using 2 wlc's for redudancy, what special config do I need to do on them, do I need to tell

  • RetainDeletedItemsFor - Command completed but no settings of username have been modified.

    Group, I'm trying to increase the retention days for deleted items on a single mailbox.  I run the command from the Technet site and it returns, "WARNING: The command completed successfully but no settings of '<user name>' have been modified."  I ver