How to access jtable cells in multiple tabs?

Hi,
in my program when I push a button 3 tabs are created. And all these tabs have a table in it. What I want to do is that When I push other button I want to access all these tables and cells. and get the cell values. How can I get the value of one cell in the jtable when I have multiple tabs?
thanks in advance.

This is my main window
public class AuditClient extends javax.swing.JFrame {
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
createCheckList();
public void createCheckList() {
CheckList.createCheckList(CheckListChildPane);
private javax.swing.JTabbedPane CheckListChildPane;
private javax.swing.JPanel CheckListParentPanel;
And This is the CheckList.java : This code create tabs and tables in it. (from xml file).
public class CheckList extends JPanel implements ActionListener{
JTable table;
public CheckList(Object[][] TheData) {
MyTableModel model = new MyTableModel();
model.setData(TheData);
table = new JTable(model);
JScrollPane scrollPane = new JScrollPane(table);
add(scrollPane);
class MyTableModel extends AbstractTableModel {
public String[] columnNames = null;
public Object[][] data = null;
public final Object[] longValues = null;
public void setColumnNames(String[] cols) {
this.columnNames=cols;
public void setData(Object[][] datas) {
this.data=datas;
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return data.length;
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int row, int col) {
return data[row][col];
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public static void createCheckList(JTabbedPane CheckListChildPane) {
//creates tabs and tables in it
I want to access the tables (which I created in CheckList java) from my main window. I want to get the cell values of these tables
thanks

Similar Messages

  • How to manipulate jtable cell?

    Hi experts,
    I created a jtable with a BC4J related to the jtable.
    I do not know how to update a cell and how to insert a new row in the jtable.
    Would someone please tell me where I can find the document about manipulating a jtable?

    Have a look at the source code of JUNavigationBar. In that class, look for JUActionBinding(_buttons[BUTTON_FIRST]   , bind, JUActionBinding.ACTION_FIRST, false);As you can see you will need the JUActionBinding class.

  • How to make Jtable cell empty onClick?

    Hi All,
    I have one requirement where I need to make the Jtable cell value empty on click or tab event. So, User does not have to do back space and delete whole string to edit that cell.
    Any idea?
    Thanks in advance.

    Hi camickr,
    Thanks for that reply. It did not work for me but Here is the thing.
    My requirement was : Client does not want to do back space in order do edit cell value when that cell clicked.
    I tried find the solution that, i can make that cell area as selected when it is clicked. my problem is solved. So, I tried to use Table select all editor.
    But here is what i found ......
    If I want that cell area selected, I need to do one more click(3 clicks at the same time) to select the value of that cell & I can put my new value without doing back space(stupid client requirement)
    Thanks for your help

  • How to use Jtable cell Editor

    HI,
    Here trying to populate the ImageIcon using JLabel in Jtable cell. For that I used DefaultCellRenderer. For implement the mouseListener to label I used the DefaultCellEditor. I am facing one problem here. After editing the label I selected the second row of the table, the first row image is not displaying. Can any one help on this issue?
    public class LabelCellEditor extends DefaultCellEditor {
    public LabelCellEditor(final JCheckBox checkBox) {
    super(checkBox);
    public Component getTableCellEditorComponent(final JTable table, final Object value,
    final boolean isSelected, final int row, final int column) {
    Color background = null;
    background = ColorManager.SELECTED_ROW_BGCOLOR;
    labelVal = (JLabel) value;
    labelVal.setOpaque(true);
    labelVal.setFont(FontManager.TABLE_DATA_FONT);
    labelVal.setBackground(background);
    labelPanel = new JPanel();
    labelPanel.setOpaque(true);
    labelPanel.setBackground(background);
    labelPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    labelPanel.setBorder(new EmptyBorder(5, 0, 0, 0));
    labelPanel.add(labelVal);
    return this.labelPanel;
    public Object getCellEditorValue() {
    return this.labelPanel;
    public class LabelCellRenderer extends DefaultTableCellRenderer {
    public LabelCellRenderer(final int alignment) {
    //setHorizontalAlignment(alignment);
    this.align = alignment;
    public Component getTableCellRendererComponent(final JTable table, final Object value,
    final boolean isSelected, final boolean hasFocus, final int row, final int column) {
    if (value != null) {
    if (value instanceof JLabel) {
    labelVal = (JLabel) value;
    labelVal.setOpaque(true);
    labelVal.setFont(FontManager.TABLE_DATA_FONT);
    labelVal.setBackground(background);
    labelVal.setHorizontalAlignment(this.align);
    labelVal.setBorder(new EmptyBorder(0, LRPADD, 0, LRPADD));
    JPanel panel = new JPanel();
    panel.setOpaque(true);
    panel.setBackground(background);
    panel.setLayout(new FlowLayout(FlowLayout.LEFT));
    panel.setBorder(new EmptyBorder(5, 0, 0, 0));
    panel.add(labelVal);
    return panel;
    return this;
    }

    With more than 30 postings you should know by now how to use the "Code" tags when posting code so the code reatains its original formatting and is therefore more readable.
    There is no need to create a custom editor, here is a simple example.

  • How Do I Launch Safari with Multiple Tabs Open to Specific Pages?

    I'd like a Windows shortcut that opens Safari with multiple tabs open to specific pages. With other browsers (Firefox, IE, Chrome, etc.), this is easily done by composing a command line that lists all desired URLs. However, Safari doesn't seem to use the same command line syntax as other browsers. Furthermore, I can't find Safari's command line syntax documented anywhere. From the comments I've seen while researching this question, I suspect this is a neglected area of Safari development, and that Safari simply can't be configured to open multiple pages. However, I'd like to make sure. Can it?
    -TC

    It strikes me that it should be possible to do that (or something similar) by building a safari extension, TC. Both Sessions and SafariRestore are able to launch multiple tabs from a previous session, so it seems like you should be able to create an extension that launches multiple tabs open to specific sites when Safari is launched.

  • Jtable cell having multiple font colors

    Is it possible to have text in a cell with multiple colors (e.g. using html)?
    -Jim

    Should be possible:
    http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
    I was able to do different colors by adding HTML to one of my table cell data items:
    <html><center><b>Enable</b> <font color=#ff00dd>middle button</font>

  • How to set warming for closing multiple tabs in FF4 beta 11

    If I have multiple tabs opened , it doesnt warm me when I try to close firefox. I even have selected the option to warm me. It only warm me when I have two seperate firefox windows opened .... I found it weird !!

    This is what did it for me!
    1. Type '''about:config''' into the location bar and press enter
    2. Then in the '''filter '''box type '''browser.showQuitWarning'''
    3. click that to true and it fixed my problem!
    all the other ones that TonyE was talking about were all ready on true, But '''browser.showQuitWarning''' Thank you TonyE for ur help !
    i hope this helps some one else! i posted a few pics hope they help!

  • How to Sort JTable data using Multiple fields (Date, time and string)

    I have to fill the JTable data with some date, time and string values. for example my table data looks like this:
    "1998/12/14","15:14:38","Unicorn1","row1"
    "1998/12/14","15:14:39","Unicorn2","row2"
    "1998/12/14","15:14:40","Unicorn4","row3"
    "1998/12/17","12:14:12","Unicorn4","row6"
    Now the Sorted Table should be in the following way:
    "1998/12/17","12:14:12","Unicorn4","row6"
    "1998/12/14","15:14:40","Unicorn4","row3"
    "1998/12/14","15:14:39","Unicorn2","row2"
    "1998/12/14","15:14:38","Unicorn1","row1"
    ie First Date field should be sorted, if 2 date fields are same then sort based on time. if date and time fields are same then need to be sorted on String field.
    So if any one worked on this please throw some light on how to proceed. I know how to sort based on single column.
    But now i need to sort on multiple columns.So what is code change in the Comparater class.
    Thanks in advance.. This is urgent....

    I think your Schedule objects should implement Comparable. Then you can sort your linked list using the Collections.sort() method without passing in a Comparator.class Schedule(Date date, String class) implements Comparable
      public void compareTo(Object obj)
        Schedule other = (Schedule)obj;
        return date.getTime() - other.getDate().getTime();
    }

  • How to set JTable cell editable/non-editable dynamically using NetBean?

    I am using NetBean 6.5, create a database desktop application, I using the persistence entity manager to bind my JTable with database.
    Now, I want to set practicular cells which are enable and disable, I tried to create my own table model and override the isEditable() method, which it seems didn't work. I guessed the problem is the persistence connection between my Table and database.
    How can I solve it? Any example? I just googled the web and can't find example which use netbean combined with database. I know that a single JTable would work when creating your own model.
    thx.

    I know what coding i did, Yes u r right but im new to GUI programming only,
    That's why i posted it to forums, I gone through the Control Flow Statements link what u have given.
    U didnt get my question at all.
    Again the problem im facing is the table is already displayed with 2nd column uneditable.
    When some Action done on table, i need to make 2nd column editable at run time.
    Thanks if u provide me the solution instead of deciding what type of programmer im.

  • How can I get rid of multiple tabs when I open Yahoo

    When I open Yahoo.mail, I get many tabs for Yahoo.
    I should only get one.
    How do I fix this so I'm not getting all these tabs. This started when I switched from Mail Classic to the New Mail & back again. Many of the excess tabs are for the Yahoo page that describes the two different versions of Yahoo mail.
    I'm using a MacBook & both Yahoo & Mozilla are up-to-date.
    Thanks!

    The suggestions didn't work HOWEVER I found a solution to my issue with this. So far it seems to work.
    Go into Firefox Preferences>general
    I reset the opening page from Yahoo In Box (which seemed to be the problem) to the default. Opened it all up then returned to Firefox Preferences & reset it back to Yahoo In Box.
    Now it seems to be working ok without all those nasty tabs slowing me down.

  • How to access (call) variables from multiple components

    I have what I think is a basic task, but I cant seem to get it to work.  I have a Flex project with one application.  In addition to the one application, I have many components that are used in the application.  These components vary from simple (a ComboBox) to complex (many sub-components).  What I need to do is define a viable in one component and access it in another component.  I can't seem to do this.  Below is an example of how I think it should be:
    Component1
    <mx:Script>
           <![CDATA[
            [Bindable]
            private var userID:int=0;
           ]]>
    </mx:Script>
    Component2
    <mx:TextInput  text="{Component1.userID}"/>
    Any help you can provide would be beneficial.
    Lee

    Hello,
         You may also want to consider using the mx.core method.
         In your main application script area define all of your public variables and functions. Then from your component, you can reference these absolutely with the following syntax.
    <!-- Main App -->
    [Bindable]
    public var userID:int;
    <!-- Component -->
    private function init():void {
         var com_UserID = mx.core.Application.application.userID;
    Using this method ensures that you will have access to any Function or variable within the scope of the project.
    Kind Regards,
    Dr. Ivan Alexander, Ph.D.
    Sr. Applications Engineer
    FlexAppsStore.com
    Sun Microsystems
    MySQL Enterprise Ready Partner 2009

  • How to set JTable cells to uneditable

    I was trying to set the cells in my Jtable to uneditable.
    I overrided the isCellEditable method. Here is what I did. But the
    cells remain editable. Any ideas?
    private class MyTableModel extends DefaultTableModel
    public MyTableModel(Vector vectRow,Vector vecColumn)
    super(vecVector,vecColumn);
    public boolean isCellEditable(int row, int col)
    if (col >= 0) {
    return false;
    }

    Just Use:
    public boolean isCellEditable(int r, int c) { return false; }

  • How to wrap JTable cell like EXCEL sheet??

    Hi All,
    I am using JTable and i want to wrap cell of that table like excel sheet whtn text length is more .
    i m using jdk 1.4.2 & jre 1.4
    can any body help me on that??
    == gavin

    Search this forum on "wrap text in table cell" I got a ton of hits.
    Cheers
    DB

  • How do I stop Firefox opening multiple tabs?

    I upgraded to version 4 of Firefox. After shutting down the other night, every time I open FF it opens 5 tabs for 5 differient websites - all in my favourites. I haved not asked for this and cannot find a way of turning it off. I tried uninstalling and reinstalling FF and the tabs still appear. A little help would be appreciated.

    Check to see if they have been set as home pages, if they have you can change the home page as shown here - https://support.mozilla.com/kb/How+to+set+the+home+page3

  • How to get the data from multiple tabes into single table

    hi all,
    here i am having 10 data base tables,how to get the data into a single table.
    regards,
    subba reddy

    hi,
    non XI/PI related
    Regards,
    Michal Krawczyk

Maybe you are looking for

  • View the document in Solution Manager

    I am told that there is an option in Solution Manager to have the document generate a link that can be emailed to the approver. This allows the approver to view the document in SM without actually having access to SM. The approver can then reply back

  • How to display an image in a Text Area

    Hi, I will like to display an image in a textarea that I created. Whereby, I will click on File>>Open>>then select an image from a file or folder. But when I select the image, all I see is a bunch of encrypted stuff. I will really appreciate it if so

  • What is the fastest processor that will work with a mega 651?

    HI, I have build a couple of 651;s in the past and am looking to build the ultimate one... according to msi the 2.8Ghz Northwood P4 is the fastest - is that correct or has anyone out there got a faster P4 to work in that machine. cheers John

  • Downloaded backup and my pictures are missing

    I had previously restored my phone from a backup stored on the cloud, the pictures downloaded - most of them, but were very fuzzy and never cleared up. I couldn't even text these old photos to friends (or email). Today I had some downtime and decided

  • Difference between different persistency providers?

    Hi, In the JPA examples I saw the use of two different TopLink Essentials persistency providers, namely: oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider oracle.toplink.essentials.PersistenceProvider Does anyone know which one should b