Hiding individual row in JTable..Urgent

Hi,
I want to hide a row in a JTable when i select hide option from a popupmenu and bring it back when i select show from the menu.I did the same done for columns by setting column width to a minimum value and then restoring it to the initial size.But a bit confused on how to apply it for a row.Can anyone help me out?
Thanx in advance..
Pri..

Thanks Greg. But my problem is when I select an item in the combobox still that column contains combobox in the table which I don't want. I want the combobox to be dissappear as soon as I select an item. This is important for me as I can change the values in the table dynamically by selecting the different panels underneath the dialog which contains this table. So, if user selects an item in the combobox ( without clicking the enter key)and then selects another panel (which loads different data ), then the selected value is set for the second panel not for the first panel(actually value shud be set for first panel).
And one more problem is samething is happening for even textfield in the table. So, how can I fire editing stopped event before setting the new data. Actually, now when I directly set the data , it is setting the data first and then firing editing stopped event, so it is setting the data for second selected panel.
Any help is appreciated.
Thanks.

Similar Messages

  • Help with adding rows to JTable

    Could any body help me with the following problem:
    I have created form where I use JTable.Initially I should show 5 rows in JTable. User can enter data into the cells.And commit I should store the data in database.
    My problem is how to dynamically add rows to JTable as user is entering the data. And how to retain the data in the cells when it is entered.
    Right now when user edits a cell and tabs to next one the data in previous cell disappears.
    Its Urgent can anybody help me
    Thanks in advance
    Babu

    The number of rows, number of columns, etc, are all determined by the TableModel used in the JTable.
    What is the easiest solution is to subclass AbstractTableModel adding methods to support your dynamic row adding/deleting/etc that you need. If you go to the javadoc for JTable, there's a link to a tutorial which contains most of what you need to know.
    - David

  • Need to Convert Comma separated data in a column into individual rows from

    Hi,
    I need to Convert Comma separated data in a column into individual rows from a table.
    Eg: JOB1 SMITH,ALLEN,WARD,JONES
    OUTPUT required ;-
    JOB1 SMITH
    JOB1 ALLEN
    JOB1 WARD
    JOB1 JONES
    Got a solution using Oracle provided regexp_substr function, which comes handy for this scenario.
    But I need to use a database independent solution
    Thanks in advance for your valuable inputs.
    George

    Go for ETL solution. There are couple of ways to implement.
    If helps mark

  • How to set background color of row in JTable

    Hi,I want to set different background color to rows in JTable according to some value in the this row.
    eg.
    no name isGood
    1 aaa yes (this row's background color is red)
    2 bbb no (this row's background color is blue)
    3 ccc yes (this row's background color is red)
    4 ddd yes (this row's background color is red)
    5 eee no (this row's background color is blue)
    thanks

    thanks!*_*                                                                                                                                                                                                                                                       

  • 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 hide row in JTable?

    Hi all,
    How to hide some specific rows in JTable for user view filtering purpose?
    Thanks

    Try to use the Table Model.
    The "getValueAt" Methode decide what to Display.
    So a simple "if" command can hide the complete row - or a single Statement.
    public Object getValueAt(int row, int col) {
    ArrayList al = new ArrayList();
    StueliTeil tabellenzeile = (StueliTeil) getDaten().get(row);
    switch (col) {
    case 0 :
    return tabellenzeile.getUmfang();
    case 1 :
    return tabellenzeile.getTakt();
    ...

  • How to distinguish individual rows in a view?

    As well known, we can use rowid to distinguish individual rows in a table. However, who know how to distinguish individual rows in a view? For there are not rowid in a view.

    I'm not sure I usnderstand your question, or at least I hope I don't.
    We do not use ROWID to distinguish rows in a table: we use unique iodentifiers, that is primary keys. A primary key is stable across the lifetime of a record: a rowid is guaranteed only for the lifetime of a transaction, and then only if we have locked that row.
    From this it follows, we should so design our views that each row in the view has a column, or combination of columns, that uniquely identify it.
    Cheers, APC

  • Inserting row in JTable (runtime)

    i need to inserting row in JTable in runtime so tell me what it do

    dear farhanaj ,
    try this code:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    /* <applet code=tableadd.class width=200 height=200>
    </applet>
    public class tableadd extends JApplet implements ActionListener
    Object[] data = new Object[5];
    DefaultTableModel defaulttablemodel = new DefaultTableModel();
    JTable jtable=new JTable(defaulttablemodel);
    JPanel jpanel= new JPanel();
    private     JPanel          topPanel,jpPanel;
    public     JTable          table;
    JButton jbutton1 = new JButton("create new row");
    JButton jbutton2 = new JButton("create new col");
    //JButton jbutton1=new Jbutton("r"),jbutton2=new Jbutton("c");
    public tableadd()
    for(int column=0 ; column<5 ; column++)
    defaulttablemodel.addColumn("column" + column);
    for(int row=0 ; row<5;row++)
    for(int column=0 ;column<5;column++)
    data[column]="cell" row "," + column;
    defaulttablemodel.addRow(data);
    //getContentPane().add(new JScrollPane(jtable) ,BorderLayout.CENTER);
    //getContentPane().add(new JPanel() ,BorderLayout.SOUTH);
    int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    JScrollPane jsp = new JScrollPane(jtable , v, h);
    getContentPane().add(jsp, BorderLayout.CENTER);
    topPanel = new JPanel();
    jpPanel=new JPanel();
    topPanel.setLayout( new BorderLayout() );
    getContentPane().add(topPanel,BorderLayout.NORTH);
    getContentPane().add(jpPanel,BorderLayout.SOUTH);
    jpPanel.add(jbutton1);
    jpPanel.add(jbutton2);
    jbutton1.addActionListener(this);
    jbutton2.addActionListener(this);
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == jbutton1)
    int numberrows = defaulttablemodel.getRowCount();
    int numbercolumns=defaulttablemodel.getColumnCount();
    Object[] data = new Object[numbercolumns];
    for(int column=0 ; column<numbercolumns;column++)
    data[column]="cell" numberrows "," +column;
    defaulttablemodel.addRow(data);
    else
    if (e.getSource() ==jbutton2)
    int numberrows=defaulttablemodel.getRowCount();
    int numbercolumns=defaulttablemodel.getColumnCount();
    defaulttablemodel.addColumn("column" + numbercolumns);
    for(int row=0; row<numberrows ; row++)
    defaulttablemodel.setValueAt("cell" row "," +numbercolumns ,row , numbercolumns);
                   System.out.println(row);
    //jtable.sizeColumnsToFit(0);

  • How to set different font for a particular row in jtables?

    How to set different font size and font type for a particular row in jtable?

    More than enough sample code here:
    [http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
    db

  • Is there any way to link the individual rows of data to the corresponding bars in a bar chart so that each legend title appears simultaneously with its corresponding bar when creating a build? I can do it in a pie chart but can't in a bar chart.

    Is there any way to link the individual rows of data to the corresponding bars in a bar chart so that each legend title appears simultaneously with its corresponding bar when creating a build? I can do it in a pie chart but can't in a bar chart.

    You used the data.  Verizon can not see what it was sued for.  However your phone can see whats apps used the data.  go to settings-data usage- there will be a place that says data usage cycle.  line the dates up with your cycle.  then there will be a bar graph below that   extend bother white bars one all the way to the left and one all the way to the right.  after those are extended below that will be a list of apps,  there should be one that used over 2 gb and that will show you what app used that data in her purse

  • How to select a row in Jtable at runtime

    how to select a row in Jtable at runtime.

    use
    setRowSelectionInterval(int fromRowIndex, int toRowIndex);example if your table has 10 rows then u want to select the rows from 4 to 8 then use
    setRowSelectionInterval(3, 7);if you want to select just one row for example 5 then use
    setRowSelectionInterval(5, 5);

  • How to remove a row from JTable

    Hi!
    I'm used to remove rows from JTables getting the model and doing a removeRow(num) like this:
    ((DefaultTableModel)jTable1.getModel()).removeRow(0);
    But with ADF and JDeveloper the model says it's a JUTableBinding.JUTableModel but its not accessible.
    How to remove a row in Jdeveloper 10.1.3.4.0?

    Or maybe is just better to refresh data in the jTable but I do not know either like doing it.

  • Change the property of a row ... urgent!!!!!!!!!!!!!!

    Hi All,
    please help very urgenttt!!!!!!!!!!!!!!!!!!!
    Breif overview of the Screen:
    user selects a customer and clicks go button then the results will be displayed in a table(query bean).
    user has an option to add a new row.
    My Requirement:
    Initially when the user clicks the go button all the records corresponding to the customer should be displayed and these records should be non-editable.when the user clicks the add button then the new row should be added and the row must allow the user to enter the values (editable mode).
    please do help me in solving this.
    thanks
    ramya

    Hi Ramya,
    OAMessageTextInputBean source=(OAMessageTextInputBean)pageContext.getParameter("Source");
    source.setDisabled(false);
    The above command will disable the entire column.
    You need to use SPEL expression to change the readonly property of individual row.
    do following steps
    1. Create a transient view attribute in your View Object. (eg XXReadOnly)
    2. Set the readonly property as ${oa.viewobject.XXReadOnly} to all the columns of the Table
    3. Now if you want to make the row read only then voRowImpl.setAttribute("XXReadOnly",new Boolean(true));
    4. to make it editable call voRowImpl.setAttribute("XXReadOnly",new Boolean(false));
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to apply different colors to specific rows in JTable

    hi,
    Anybody could tell me the way of colorising the rows in jtable.. I want to apply different colors to diff rows..
    If i get a piece of code that could help me a lot..
    thanks in advance,
    Sapna

    you'll find the answer at http://www2.gol.com/users/tame/swing/examples/SwingExamples.html

  • Delete row in JTable

    Hello I am new To JAVA SWING
    I have 2 questions related to JTable
    1) How do i remove selected row in JTable ...for instance, I click on the row to delete (It is selected) , later I press the delete button, and then row is removed .... any hints ?
    2) If I would like to save the rows in a JTable into a database , .... How can iterate through the rows in the JTable..each row .... the rows are saved in a List object...and a List Object is what I pass as a parameter in a class method in order to be saved into Database.
    Thanks,
    deibys

    1) use the removeRow(...) method of the DefaultTableModel
    20 use table.getModel().getValueAt(...) to get the data from the model and create your list Object.

Maybe you are looking for

  • Photoshop cc lighting effects do not seem to work

    I am trying to put spotlight on area in photo but from render - lighting effects all that happens is my workspace changes on the right to "lighting effects" but nothing works and I have to close this side and shut down photoshop just to go back to a

  • JBCL 2.0 and Oracle 8.0.5 Objects Option

    I4m working with JDeveloper 3.1.1.2 using JBCL components and Data Express to connect to an Oracle 8.0.5 database with Objects Option. I use a valid SQL like : SELECT C.DENOMINACION AS DENOMINACION, C.OBSERVACIONES AS OBSERVACIONES, C.FECHA AS FECHA,

  • No cubes are reflecting in XIP ,after creation of manual IDOC

    Hi Experts, I am got a mail from client saying that "No cubes are reflecting in XIP ,after creation of manual IDOC".. Please tell me weather this is issue is related to XI or not if it so, Can you please anybody tell me how to look into this type of

  • Simple 1 page document feeder sheet

    Where can I find for purchase a simple 1-page manual document feeder sheet for my HP T45?  I'm certain the make does not have to be HP!  It's a simple clear mylar topped white sheet of paper that allows items such as newspaper article to be inserted

  • CSS Display table with the bottom border alone

    Hi all, I am very poor in CSS, I badly in need of a style. I want the table with the bottom border alone i tried like <table frame="below" cellpadding="2px" cellspacing="0" style="overflow:scroll;empty-cells:show;border:1px solid #285577;" width="350