How edit/focus/resize columns of JTable that is node of JTree?

I have added a JTable as a node on a JTree, but now I can't interact with it. I think that it is because all mouse/selection actions are grabbed by the JTree. However, I can't figure out how to pass these on to the table.
What method do I call? I can't seem to find a way to get which column I have clicked over, and even if i did, i can't find a method to actually select it!
please help!

Hi,
your questions I had got some time ago, and I solved the problem . It means you will as well.

Similar Messages

  • Resize columns in JTable

    hi there,
    my JTable is using AccountTableModel which is extending the AbstractTableModel. I am trying to re-arrange the column size, so that when it display will be a different length.
    currently they all in the same sizes, user can always rearrange the column if they can't see any of the wordings but is not the best options.
    If u know a way to re-arrange the cloumns sizes please please do let me know.
    ie. Name, Location, size
    Name column will be in size 14
    Location column will be in size 10
    size column will be in size 6

    you have a JTable t....
    TableColumnModel tcm = t.getColumnModel();
    TableColumn colName = tcm.getColumn(tcm.getColumnIndex("Name"));
    TableColumn colLocation = tcm.getColumn(tcm.getColumnIndex("Location"));
    TableColumn colSize = tcm.getColumn(tcm.getColumnIndex("Size"));
    colName.setPreferredWidth(14);
    colLocation.setPreferredWidth(10);
    colSize.setPreferredWidth(6);

  • How do I resize a div/element that's position fixed with css ?

    Supper,
    I set up a fixed element using this code in stage/ composition ready :
    sym.$("body").append(sym.$("Group").css({"position":"fixed"}));
    The element does "position:fixed" but its size has changed.
    How do I resize it to its previous size?
    I tried the same css insertion method with size properties as I used in "fixed"( example above) .
    It Failed.
    So second question is based on that it also loses its "responsive scaling" properties
    (just the "fixed" element not the rest of the project)
    and no longer zooms in scale.
    Can I fix an elements position and maintain scaling with the rest of the project at 100% width?
    My objective is to scroll under a fixed element scaled to fit browser.
    Thank You,
    Henry

    According to the InDesign Help file:
    Do one of the following:
    (Windows) Start InDesign, and then press Shift+Ctrl+Alt. Click Yes when asked if you want to delete preference files.
    (Mac OS) While pressing Shift+Option+Command+Control, start InDesign. Click Yes when asked if you want to delete preference files.

  • The photoshop window is larger than my computer screen. How do I resize it horizontally so that the bottom is visible?

    The photoshop window is larger than my computer screen. How do I resize it so I can see the bottom controls? I tried dragging the corner, but it only moves vertically. I need the horizontal to move so I can see the bottom of the window.

    Which version of photoshop and operating system are you using?
    On a mac, did you try clicking on the Green Maximize button?
    On a windows os did you try the Maximize button at the top right of the photoshop window?

  • How to set a column in JTable non-editable?

    I have a JTable, and how can I set a particular column non-editable?
    Thank you.

    You could create a sub class of DefaultTableModel, you pass the column number to the constructor or you add a method like setColumnEditable(0, false); to set column 0 non-editable.
    You overwrite the method isCellEditable so it will return false when the column number that is passed to the method is 0 (if you want to have column 0 non-editable).

  • How to disable moving Columns in JTable

    Hi,
    How can I make sure that the columns in my JTable cannot be moved?
    Any ideas?
    thanks

    How about:myTable.getTableHeader().setReorderingAllowed(false);

  • When resizing columns in JTable the last columns disappear

    I have a problem. I created a JTable and I set the AutoResizeMode to AUTO_RESIZE_NEXT_COLUMN in order for the columns to fill the whole panel. I added the table to a JScrollPane. when I resize the columns, the other columns start to adjust in size to fit the data grid, but it gets to a point where the columns scroll out view. is there a way to stop the other columns from moving when I resize one of the columns. I dont want the horizontal bars to show.

    When your mouse pointer is over a movable area, the mouse pointer should turn into a double-arrow. If you notice that after dragging and releasing the mouse, the mouse pointer ''stays'' a double arrow, try positioning the mouse pointer where you want the new boundary and click again. The mouse pointer should change back to a standard pointer.
    Does that work?
    (This suggestion is based on behavior I've seen with some Infragistics ASP.Net controls in IE8.)

  • How to hide the column in JTable

    Hi
    I want to hide a column . But I would be needing the data in that column. ( I have 4 columns )
    I want to hide 4th column
    I have done these steps
    MyTableModel  myTableModel= new  MytableModel(t);
    myTable  = new JTable(myTableModell);                 
    mTable.getColumnModel().removeColumn(myTable.getColumnModel().getColumn(3));When I trying to read the column 1 value it is giving the exception
    myTable.getValueAt(row,3).toString();It is giving the arrayboundexception
    Can anybody tell me what is the correct method to do ?
    Thanks and regards
    Anshuman

    Thanks for reply .
    I have taken the value as the convertRowToModel
    WalterLaan wrote:
    You get an exception because the table doesn't have a column at index anymore, but you can still ask the model.
    table.getModel().getValueAt(table.convertRowToModel(row), 3);
    But it is giving the same error
    java.lang.ArrayIndexOutOfBoundsException: 4 >= 4
         at java.util.Vector.elementAt(Unknown Source)
         at javax.swing.table.DefaultTableColumnModel.getColumn(Unknown Source)
         at javax.swing.JTable.convertColumnIndexToModel(Unknown Source)
         at javax.swing.JTable.getValueAt(Unknown Source)Edited by: techie_india on Jul 6, 2009 10:38 PM

  • How do you resize columns in Ipod app?

    I can't see the entire song name in the Ipod app - is there a way to resize the columns in this app (in song view)?

    Ditto here... it's VERY annoying that only a few characters are visible of my MP3 collection. Unlike most people, I've decided not to use ID1 or ID2 tags on my CD collection, and therefore rely on the filename itself that will display:
    Artist Name - [Album Name - 01] Track Name.mp3
    Artist Name - [Album Name - 02] Track Name.mp3
    Artist Name - [Album Name - 03] Track Name.mp3
    Artist Name - [Album Name - 04] Track Name.mp3
    With the iPad, it's pretty much just the "Artist Name" that I would see, and nothing else.
    APPLE PLEASE HELP, as there has to be a better way!

  • How do I resize columns in iTunes 11 store?

    When in the iTunes 11 store, and after searching for a particular artist, I see the results.  However, many of the song and albums names are cut off since the columns are too narrow.  But I can't find any way to adjust them - there's no column headers to grab onto and I don't see anything relevant in the view options.
    Does anyone know how to adjust the width of these columns?

    I don't believe that there is any way now to send an anonymous gift. The store does send the email, but to the best of my knowledge it always attaches the sender's information. If you want to give an album anonymously, you can either see if any of the other download stores allow this, or of course buy the physical CD and send it without any return address.
    Regards.

  • Finder-How to set resize column without handle

    I want to change my finder divider column from having handles to resize the the column....  Where you have to drag the handle or double click it to resize the column.
    I want it to have just the Line that divides the columns... Where you can double click anywhere on the line to resize the column.
    From this...
    To this...

    to set column widths try this:
    TableColumnModel tcm = table.getColumnModel();
    TableColumn col = tcm.getColumn(column_number);
    col.setPreferredWidth(column_width);
    should work...
    Takis

  • How do I resize a page so that I can see all of both right and left of page???

    I cannot read the left side of pages. This includes ALL pages!!!!

    Try to remove the Firefox plist file (org.mozilla.firefox.plist).
    * http://www.macfixit.com/article.php?story=20060606082246983 How .plist files become corrupt and troubleshooting the results
    Go to "Library > Preferences" and remove the plist file for Firefox (org.mozilla.firefox.plist).
    You can also try to remove the file localstore.rdf
    *http://kb.mozillazine.org/Corrupt_localstore.rdf

  • How can I make columns appear, so that info lines up on a page?

    So, I'm creating a resume as one of the pages for my website on iWeb.
    When I took the info from a table in mac Pages and placed it on the page, it landed in one tall column, and I had to manually space it out. The tab doesn't even work to space it. And to make everything line up from one row to the next, I had to choose a even width font (courier).
    When I look at the published website on my mac, the columns are lined up.
    When I look at it on a pc, the columns are not.
    What can I do?

    Read my blog :
    [Create and add a TABLE in iWeb|http://www.wyodor.net/blog/archives/2010/01/entry_297.html]
    [More about a TABLE in iWeb|http://www.wyodor.net/blog/archives/2010/01/entry_298.html]

  • Editing of a  Column of ALV Tree(OOPS) node

    is it possible to edit a column of node of ALV tree.
    i am using ALV class "CL_GUI_ALV_TREE".
    After searching existing threads, for the same issue..i found the following.
    1) Editable Tree ALV
      ( displays pop up window where user can change values and then transfer these changes back to ALV tree)
    2) Editable Field in ALV TREE Display Using OOPs
         (this approach is not working for ALV Tree)
    But i want to edit directly coulmn of a node of ALV tree.
    is it possible in  OOPS ALV Tree?
    if it possible, can any one provide the sample code,

    As you already noticed, this is not possible, but you may edit your fields outside the tree and bring your changes back to tree. I struggled with the same once but eventually used described alternative. If you use saplink you may check upgrade [chain and rename|http://code.google.com/p/saplink-chain-and-rename/downloads/list] where this approach is released. The code is free so you will be able to study and copy whatever you need from it.
    Editing in a pop up is also an alternative here.
    Regards
    Marcin

  • Selectable JTable as leaf node in JTree

    I've created a TreeCellRenderer that renders a JTable for nodes of type TableNode. The actual rendering seems to work fine, but the problem is that I am unable to select the rows in the JTable. I tried using a JTable-based TreeCellEditor, but that wasn't what I needed either. I don't need to edit the data, but only select an individual row so I can get its data to display in another panel on the screen.
    Any ideas?
    private class TableTreeCellRenderer extends DefaultTreeCellRenderer {
       private JTable table = new JTable();
       private DefaultTableModel model = (DefaultTableModel) table.getModel();
       public Component getTreeCellRendererComponent(JTree tree,
                                            Object value,
                                            boolean selected,
                                            boolean expanded,
                                            boolean leaf,
                                            int row,
                                            boolean hasFocus) {
         if (value instanceof TableNode) {
               TableNode node = (TableNode) value;
            model.setDataVector(node.getData(), node.getHeaders());
            JScrollPane js = new JScrollPane(table);
            js.setPreferredSize(getTableSize(table));
            return js;
         return super.getTreeCellRendererComponent(tree,
                                                      value,
                                          selected,
                                          expanded,
                                          leaf,
                                          row,
                                          hasFocus);
       private Dimension getTableSize(JTable table) {
          return null;
    }

    A renderer isn't a component which is added to a parent (tree in this case). It is only used for display purposes. You might try a [url http://java.sun.com/products/jfc/tsc/articles/treetable1/index.html]TreeTable.

Maybe you are looking for

  • Final Cut Pro X to Premiere CS6 workflow destroys FCP X events

    Hello, I just got a call by a customer who tried to convert and FCP X project via XML to Premiere CS6 for a further AfterEffects workflow. He experienced the following problem, which I can rebuild completely. These are the steps: 1 - Export an FCP X

  • I am being charge repeatedly on the same day and r...

    I have just been notified in three emails that I have been charged $7, $14 and $35 in subscription renewals on the same day. I have not used Skype today, so either my account has been hacked or your system is broken. Please revert immediately and fix

  • FF4 fonts and photos look funny

    OK, so I installed FF4 in w7, std installation-- the fonts in my usual sites all look funny and disconcerting (I just accepted font defaults, no tweaking). Pictures in my messages on a social site had a white border at top and bottom. Switched back t

  • Replace n:th string

    Anyone have a nice suggestion for how to replace the n:th string in a string. Example lets say we have text = "wooho wooho wooho". And i want to call text.replace("wooho", "blaha", 2); Which would replace the second occurence in the string so that it

  • Biw software

    Dear Experts, I just now started to learn BIW, Is there any biw software (learning edition) to download or CD's available. In ABAP one book called 'ABAP for OBJECTS' offering ABAP software CD (learning Edition) like same does any book offers biw soft