Making some Custom Column Renderers for a JTable

Hello People
I've been playing around with a JTable by following the tutorial "How to Use Tables". (I am using netBeans 4.1 to "sculpt" my swing objects onto the nice palette in the IDE. I don't know if this has anything to do with the errors but, it seems like netBeans requires some Gui components be initialized via this abovementioned "palette")
I believe that I need to somehow tell the JTable about what kinds of objects are in it so that it can render itself properly. I have a table set up with some default values in it
->Strings both Editable and Not-Editable
-> Integers both Editable and Not-Editable
-> Boolean rendered as a check box Editable
So upon startup, my progarm renders the table correctly. I have a button to clear all of the elements in the table, which works fine. It is only when I switch to another window, then switch back to an empty table ... the JTable needs to redraw itself. This is when I'm getting the error:
java.lang.NullPointerException
        at ElementHelp.PrimitiveManager$MyVectorTableModel.getColumnClass(PrimitiveManager.java:93)
        at javax.swing.JTable.getColumnClass(JTable.java:1752)
        at javax.swing.JTable.getCellRenderer(JTable.java:3700)
        at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1148)
        at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
        at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
        at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
        at javax.swing.JComponent.paintComponent(JComponent.java:541)
        at javax.swing.JComponent.paint(JComponent.java:808)
...blah blah more exception stack.....
       I think that because there are no elements in the table that the call to "getClass" for an element in the table returns a NullPointerException. I think I can avoid this via telling the JTable about the types of objects each column will contain. The tutorial suggests one of two solutions: (neither of which I can get to work)
1) Use a class that extends the DefaultTableCellRenderer
2) I should write somthing that ...extends JLabel and implements TableCellRenderer.... such as the tutorials ColorRenderer example. Which solution should I work out if I want my table to add/delete rows and be able to have a few cells edited. (It will never be restructured .. the column types won't change)
Also, I've created my own TableModel for it ... a class that extends AbstractTableModel ... (although not declaired, it also implemnts/overwrites functions from the TableModel interface)
Any suggestions on avoiding the abovementioned error?
thanks and happy holidays to everyone

I think that because there are no elements in the table that the call to "getClass" for an element in the table returns a NullPointerExceptionWell, if you have no data in the table then your TableModel should be returning "0" for the number of rows in the table and it won't be a problem.
Also, I've created my own TableModel for it ... Why? Use the DefaultTableModel it supports String, Integers and Booleans without any need for custom coding.

Similar Messages

  • Custom column headers for JTable in JScrollPane

    I want a heirachical header structure on a scrolled JTable. I've successfully generated a second JTableHeader which moves it's tabs with the normal header. If I add the secondary JTableHeader into the container above the whole scroll pane it's does almost what I want, but it's not quite correctly aligned.
    What I want to do is to put both the automaticaly generated JTableHeader and my extra one into the JScrollPane's column header area.
    I wrapped the two headers together into a vertical Box and tried calling the setColumnHeaderView() on the scrollpane, and then creating a JViewport and using setColumnHeader(). Niether seems to have any effect. The basic table header obstinately remains unaltered.
    There seems to be some special processing going on when JTable and JScrollPane get together, but I can't understand how replacing the column header viewport can be ineffective.

    Thanks. I think I've just cracked it more thoroughly, though. [I found this bug report|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5032464]. This has guided me to a work-around that seems stable so far. I'm using an extended JTable class anyway (mostly to do with table header width behaviour). I've added a field to my own table class and the following override:
    The trick is to work out where the dirty deed is done, having search all the scroll pane related classes for special casing JTable.
    public class STable extends JTable {
        @Override
        protected void configureEnclosingScrollPane() {
            if (secondaryHeader == null) {
                super.configureEnclosingScrollPane();
            } else {
                Container p = getParent();
                if (p instanceof JViewport) {
                    Container gp = p.getParent();
                    if (gp instanceof JScrollPane) {
                        JScrollPane scrollPane = (JScrollPane) gp;
                        // Make certain we are the viewPort's view and not, for
                        // example, the rowHeaderView of the scrollPane -
                        // an implementor of fixed columns might do this.
                        JViewport viewport = scrollPane.getViewport();
                        if (viewport == null || viewport.getView() != this) {
                            return;
                        JPanel hdrs = new JPanel();
                        hdrs.setLayout(new BorderLayout());
                        hdrs.add(secondaryHeader.getHeader(), BorderLayout.NORTH);
                        hdrs.add(getTableHeader(), BorderLayout.SOUTH);
                        scrollPane.setColumnHeaderView(hdrs);
                        //  scrollPane.getViewport().setBackingStoreEnabled(true);
                        Border border = scrollPane.getBorder();
                        if (border == null || border instanceof UIResource) {
                            Border scrollPaneBorder =
                                    UIManager.getBorder("Table.scrollPaneBorder");
                            if (scrollPaneBorder != null) {
                                scrollPane.setBorder(scrollPaneBorder);
        }I'm hopeful that will prevent the column header view from being overwritten by later layout operations.

  • JTable custom column renderers

    Hi,
    I am using a custom column renderer to format a date value in the table, and am passing back a checkbox. However, i am unable get the jTextField to look/act like the default rendered componenets, ie. if i select them they have the same uneditable colour. How can i get the same behaviour.
    Thanks
    Rudy

    Hi,
    I think this could be a possible bug in Java, because when i changed my LookAndFeel to the default (metal) the entire table row appeared selected when it was selected. Each of the textFields rendered correctly. However, when i change it to my system look and feel (windows) the jTables rows to not render correctly and the textfield columns of the selected row appear to have a white background, and a white foreground. Which means the text which is originally black disappears??
    Any suggestions greatly welcomed.
    Rudy

  • ATP for 1 st.location for some customer and other for other customer

    Hi,
    I have a sceanrio, where a cash customer walks in the store, picks up 10 pcs from the shelf come to the counter pays and moves out. In the same plant I have run a availability check on a account customer as per requested delivery date, was supposed to give same 10 pcs. So availability check is of no use here.
    But I can control this if I mark storage location 0001 for Walkin Customer and 0002 for Account customer in the same plant , In this I will run Av Check for account customer and can commit him dates and at the same time walkin customer also gets his material.
    So can anybody tell what should be end to end process
    Regards
    Naveen

    Hi,
    Alternatively, you can configure your system, as per your suggestion to the account customer and walk in customer.
    What you can do is keep a seperate stock of the account customer and a seperate stock of walk in customer.
    You can reserve the account customer stock prior to 10 days while walk in customer needs no prior reservation, as the quantities required by him on single dealing basis would be low.
    This will help you solve your availability check.
    regards,
    Siddharth.

  • Making a custom lense hood for HD Video cameras...i.e. the HDR-HC1

    i attached it to the supplied lens hood that came with that camera....this one is only made out of cardboard, black electrical tape, spray-painted with a couple coats on it, added a UV/lens protector and i have a film movie-looking camera. (cant show you the picture with it on the camera, becayse im using it to take picts) and suggestions to making a better one out of what materials/tenique? (the shadows mess up the pictures)
    http://img220.imageshack.us/img220/6863/dsc00815wv6.jpg
    http://img220.imageshack.us/img220/5065/dsc00814nm0.jpg
    http://img241.imageshack.us/img241/1637/dsc00813cs8.jpg
    Mac Mini Intel 1.83Ghz; PowerBook G4 1.0Ghz   Mac OS X (10.4.8)   Lacie Lightscribe, Pioneer 7.1VSX-526, Polk Audio RM6005, iPod Nano, HDR-HC1

    Johnny,
    Great attempt! Now you've even got a template you can use to build another one out of some other material. I'd suggest using 1/8" or 1/4" black acrylic sheet (or perhaps even black anodized aluminum) for your next try. The acrylic pieces could be epoxied or MEK'd together and the aluminum could potentially be templated as a 2-part unit, thereby minimizing the number of seams. Both would be stronger than cardboard.
    I remain completely baffled at the prices of commercial filter holders, sunshades and matte boxes for videocams. Good for you, building one on your own!

  • Restrict all the text in a datagrid input without having to create custom item renderers

    Is there a way to restrict all the text in a datagrid input
    without having to create custom item renderers for each
    column?

    How are you trying to restrict it? If you're trying to
    restrict it uniformly, for example, to entirely numerical inputs,
    then the easiest way I know of to do so is with an itemEditor. You
    can just add the same itemEditor to each column that way.
    This only saves work over custom renderers if you're trying
    to restrict multiple columns in the same manner, but for numeric
    only tables, it's pretty short.
    You could probably also do it with itemEdit and
    itemEditBeginning events, but that would likely be more work then
    simply declaring a single global itemEditor and using it in all
    your columns.

  • Making a cutsom event handler for nodes

    hi i was wondering how to go about making a custom eventhandler class for nodes
    for eg. if a have a circle (c1) in the main.fx file
    and i want to assign it Mouse and Key events(using onMousePressed etc)
    but i dont want to write it in "c1"'s definiton directly coz i want the event handling code to be useful for another circle i may create later(call it c2)
    can some tell me how to go about it ?
    Appreciated. :-)
    UPDATE:
    ok i just realized that i could simply write a modified Circle class extending the Circle class.
    So i can just create a new modified Circle object when needed.But how do i exactly write the class.The fixed variables i can simply override.But what about the event handling properties of the circle,how do i make sure they are initialzed for that object when the modified Circle object is created? what is the syntax??
    Edited by: apratim_pranay on Apr 22, 2010 6:16 AM

    hey i tried making a circle class like the above..
    drag works fine..
    thing is.. i've nested some effects..which "SHOULD" toggle on on keypresses ,but even though the key press is detected..effects dont appear..
    public class modCircle extends Circle{
    var c1e2:Glow;
    var c1e4:Reflection=Reflection {bottomOpacity:0.0 topOpacity:0.5
                                 fraction: 0.75 topOffset: 0.0};
         override var centerX=40;
         override var centerY=199;
         override var radius=40 ;
         override var fill= Color.BLACK;
         override var effect=c1e2=Glow {level:0.1 input:c1e4};
    override def onMouseEntered= function( e: MouseEvent )
                              {requestFocus();}
    override def onKeyPressed= function (e: KeyEvent): Void
                               if(e.code==KeyCode.VK_G)
                                   if(c1e2.level==0.1)
                                    {c1e2.level=0.9}
                                   else
                                    {c1e2.level=0.1}
                                 if(e.code==KeyCode.VK_M)
                                   if(c1e4.topOpacity==0.5)
                                     c1e4.fraction= 0.75;c1e4.topOffset= 0.0;
                                     c1e4.topOpacity= 0.5;c1e4.bottomOpacity= 0.0;
                                   else
                                     c1e4.fraction= 0.75;c1e4.topOffset= 0.0;
                                     c1e4.topOpacity= 0.5;c1e4.bottomOpacity= 0.0;
    }why is this happening??

  • Adding custom column to Process tracking view

    I have a requirement that in process tracking screen, some custom column (e.g instruction) should be added so that different processes listed there can easily be differentiated.
    I tried to do this change in Workspace through Preferences->Manage Column Headings -> Tracking. But it affects only the Tasks view (Audit tab) for the process and not the initial process tracking screen. I also tried creating a process variable and made it Visible in UI and Searchable so that it is shown in the column heading list. But still that heading does not show up in the initial process tracking screen.
    Is there way through which we may be able to customize the column headers for the initial tracking screen?
    (The server is Livecycle 8.0.1)
    Thanks,
    Ashutosh

    Not that I'm aware of.
    However, we have built an enhanced tracking and enquiry tool that provides a lot more flexibility than the built-in tracking, and is also very easy to configure.
    Read about it: http://www.avoka.com/avoka/enquirytool.shtml
    Try it: http://www.avoka.com/apps/checkcookie?location=/apps/qpacdownload&qpac=y&qpac_code=Worksp aceEnquiryTool1.8
    Howard
    http://www.avoka.com

  • How to make the display of custom column names in UWL(not bother abt values

    Hi all
    i want to make the display of custom column names in UWL ( for example GP)
    i dont want or not looking about values for those custom columns . i know that thru custom connector we can achieve to retrieve the values for those custom columns. but currently i am looking only just to display the custom column names( for example GP custom column names, just i want to display the name of the columns ) in UWL .
    Thanks
    Sunil

    Hello Prashant,
    You can add the control to your custom pagelayout, the following article has an example:
    http://spandps.com/2012/02/22/showing-the-audience-target-field-in-an-editmodepanel-sharepoint-sp2010-in-projectserver-ps2010/
    Btw, the SPFieldTargetToControl has a required property:
    http://msdn.microsoft.com/en-us/library/microsoft.office.server.webcontrols.fieldtypes.spfieldtargettocontrol.required(v=office.14).aspx
    - Dennis | Netherlands | Blog |
    Twitter

  • Custom FPM Application for MSS

    Hi folks,
    I am trying to create some custom portal pages for MSS that will contain the Employee Search and other iViews based on the Generic iView List and/or Generic iView Table templates.
    The Business Package document for MSS (mySAP ERP) says that I have to create a new delta-linked  FPM Application and assign the required views to the perspective, which I have done via the Self Service Administrator role.
    The problem is, when I then try to create the new WebDynpro Java iViews, I can't see my FPM Application or views in the list.
    I am aware that I can just add extra views to the standard FPM Applications for MSS, but I really don't want to risk having those overwritten by support packs later on.
    Has anyone successfully done this before?
    Regards,
    John

    btw, I was kidding about the creators of the old FPM sitting in the corner
    When the new Java based ESS/MSS screens first came out they were so much better than the old IAC's, and we were very grateful for that.  We used them extensively where they could just be deployed "out of the box".
    Once we figured out how to integrate our own generic query iViews into the FPM framework for MSS we used lots of those too.
    I guess in a way they were too successful, and as a result the business kept demanding more and more self service applications that often weren't delivered as standard.
    Not being a Java shop (i.e. zero Java developers) we soon found that there was only so far we could go with the standard WDJ services.  Even something relatively simple like adding another standard field to a standard ESS screen without going down the NWDI path proved to be a rather frustrating process (for us at least), so we just started buidling our own with WDA.
    From a functional perspective, I don't really care if an application has been built in Java or Abap, as long as it does what I want, every time.  I can't see us going back and changing the standard Java services that we still use over to Abap, but for future developments the reality for us and lots of other customers is WDA.
    cheers.
    John

  • 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 :)

  • Custom column in a list view web part for a multilingual site does not take on custom language labels. Stays in default language.

    Hello all,
    I have what so far appears to be a fairly unique problem.  We are running a multilingual SharePoint 2010 environment with English as the default language and French as the secondary.  We have setup the sites in a variance relationship, but the
    issue I am discussing happens outside of a variant as well.
    We have created a library outside the variant (but within the collection) that the two sites must share.  A list view web part was created via Designer to add to each site to provide a quick view into the list.  If we are in the libary and switch
    to French, then update the column label it will remember the setting (because of the resource file) and maintain it as the language is flipped back and forth.  Where it doesn't work is as a web part in a variant or where the language is different.
    If the language is different, the out of the box columns work find, but the custom columns (all site columns not library\list columns) remain as the english label.  It doesn't matter if within a variant or outside with the browser language changed. 
    It always reverts back to English.  It's like it isn't using the same resource file that was used in the list itself.
    I created a custom view and modified it with xslt as per
    http://sharepoint.stackexchange.com/questions/50004/how-to-change-column-title-for-a-view-but-not-modify-the-list but this only worked within the list and did not occur in the list view either.
    I can't be the first that has come across it, either I am not performing my searches properly, no one has ever documented a fix for this or this is something we just can't fix with OOTB tools.  That's the other thing, the solution has to be accomplised
    OOTB or with minor client side changes.  I can't fire up Visual Studio because they are piloting Office 365 and have put a "No custom code" mandate on for migration.
    Thank you all in advance.

    Ok, I have come up with a solution.  I edited the XSLT for the web part on the page.  I did the following:
    1.    Create the variants in the Site Ccollection
    2.    Create the library outside of the variants.
    3.    Add all the columns you require for the library.  It is very important all the columns are there before you move on.
    4.    Create a French and English view.
    5.    Create the list view web part via designer.
    6.    Add the list view web part to each site selecting the appropriate view to use.
    7.      Edit the page in SharePoint Designer 2010.
    8.      Place cursor in the column you wish to modify.
    9.      Click Design in the List View Tools on the ribbon.  
    10.     Then click Customize XSLT and select Customize Item.  Select this option otherwise you will generate a **LOT** of unnecessary XSL code.
    11.     You are looking for a piece that resembles the following:
            <xsl:with-param name="fieldtitle">
              <xsl:value-of select="@DisplayName"/>
            </xsl:with-param>
    12.      Modify it by typing in the actual column name you want.  You should end up with something like this:
            <xsl:with-param name="fieldtitle">
              New Column Name.
            </xsl:with-param>
    13.      Now, for this page only, the column will be renamed.
    There are some caveats:
    1.    Doesn’t appear to work in a publishing portal.  I think this has to do with how SP stores the pages in this case.  In a publishing portal you can only modify the page layout which won’t work as we need to modify the content.
    2.    If you add another column, you will need to repeat the XSLT modification
    Anyways, I hope this helps out any others with the same issue or need as I had.

  • Custom Column for Project Code Number & Search Box to search Content in Project Server 2013

    Hi all,
    I want to add a custom column in Project Center view for showing some Numerical Projects codes like 4523, 5248,8956 like that... Each code will represent Project assigned with that code in Project Server 2013. Also let me now if i can add some search box
    in Project Center page through which i can search Project Code or Project Name. Currently, provided search bar not working in Project Server 2013.
    Need it urgent..Kindly help

    Hi,
    If you want to add this column in a project center view, be careful to choose a project view in the "manage views" views' list. Also it must be a project custom field and not a task field. As Paul said, we assume that the field with the code exists
    and has been previousky created by you.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, MCP |

  • Problems with JTable custom cell renderers

    Hi All,
    I'm having a bit of a problem writing a custom renderer for a JTable.
    What seems to be happening is that the changes I apply in the renderer to the component are applied to ALL cells.
    All I want to do is have a different background color for certain cells....
    Ive derived from DefaultTableCellRenderer, so Im using its getTableCellRendererComponent to do most of the work.
    So, Ive got something like this:
    private class DirtyCacheRenderer extends DefaultTableCellRenderer
        public Component getTableCellRendererComponent(JTable table, Object value,
                              boolean isSelected, boolean hasFocus, int row, int column)
          // Modifies 'this'
          super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
          // If the row/column is 'dirty' (I.e - if I want 2 color it diferently)
          if(((EditableTableModel)table.getModel()).isDirty(row,column))
            // The column is dirty. Set the color accordingly:
            super.setBackground(DIRTY_COLOR);
          return this;
      }The effect is that as soon as ONE cell gets its color set above, all of the cells do!
    Please help, its driving me mad!!!
    D

    I tried this and it worked. Tell me if it is OK for you.
    import javax.swing.table.TableCellRenderer;
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.JTable;
    import javax.swing.JLabel;
    public class testRenderer implements TableCellRenderer {
    JLabel cell = new JLabel();
    Color dirty = new Color(100,100,100);
    Color clear = new Color(0,0,0);
    public testRenderer() {
    cell.setOpaque(true);
    public Component getTableCellRendererComponent(JTable table,Object value,
    boolean isSelected,boolean hasFocus, int row, int column) {
    cell.setText(value.toString());
    // The column is dirty. Set the color
    if (row == column)     {
    cell.setBackground(dirty);
    } else {
    cell.setBackground(table.getBackground());
    return cell;
    }

  • Can't set custom column widths in JTable

    I'm trying to set custom columns widths. They are set as I wish but then they are reset to default values (all columns have the same size). This is caused by method JFrame.setVisible(true) which invokes JTree.setWidthsFromPreferredWidths(). It can be investigated from following stack trace printed when a column being resized (see below).
    How to prevent this auto width sizing?
    P.S. can't override JTable.setWidthsFromPreferredWidths(); seems it's private
    table = new JTable(model) {
         public void columnMarginChanged(ChangeEvent event) {
              new Exception("stack trace").printStackTrace();
              super.columnMarginChanged(event);
    // setting here custom columns widths via table column model ...java.lang.Exception: stack trace
         at mtu.gui.TrackList$1.columnMarginChanged(TrackList.java:30)
         at javax.swing.table.DefaultTableColumnModel.fireColumnMarginChanged(DefaultTableColumnModel.java:615)
         at javax.swing.table.DefaultTableColumnModel.propertyChange(DefaultTableColumnModel.java:679)
         at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:264)
         at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:232)
         at javax.swing.table.TableColumn.firePropertyChange(TableColumn.java:249)
         at javax.swing.table.TableColumn.firePropertyChange(TableColumn.java:255)
         at javax.swing.table.TableColumn.setWidth(TableColumn.java:482)
         at javax.swing.JTable$2.setSizeAt(JTable.java:2242)
         at javax.swing.JTable$5.setSizeAt(JTable.java:2336)
         at javax.swing.JTable.adjustSizes(JTable.java:2372)
         at javax.swing.JTable.adjustSizes(JTable.java:2340)
         at javax.swing.JTable.setWidthsFromPreferredWidths(JTable.java:2250) <======
         at javax.swing.JTable.doLayout(JTable.java:2165)
         at java.awt.Container.validateTree(Container.java:1089)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validateTree(Container.java:1096)
         at java.awt.Container.validate(Container.java:1064)
         at java.awt.Window.show(Window.java:455)
         at java.awt.Component.show(Component.java:1134)
         at java.awt.Component.setVisible(Component.java:1089) <=====
         at mtu.gui.Test.test_03(Test.java:56)
         at mtu.gui.Test.main(Test.java:29)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.intellij.rt.execution.application.AppMain.main(Unknown Source)

    When I create the table I have code like this:TableColumn col = getColumnModel().getColumn(2);
    col.setMinWidth(width + 4);
    col.setMaxWidth((int)(width * 1.2));Works just fine for me. The setWidthsFromPreferredWidths() method will use these limits as far as I can see.
    PC&#178;

Maybe you are looking for

  • HP laser printer compatiblity

    hi, Pls share latest hp laser printer compatiblity list with mac os x

  • Duplication of pr00 in sales order

    In our sales order the pr00 condition is manual , Many a times the user give more than once the pr00 condition , the system accepts the same . How to supress this . I am using the user exit FORM USEREXIT_PRICING_PREPARE_TKOMK OR FORM USEREXIT_PRICING

  • Can you still add to a project once you've exported it?

    I'd like to so my dad my project so far but since he lives far away, I'd have to export it or burn it to a dvd, I guess. But then can I still add to it afterwards?

  • If you are good at Booleans please help!

    I modified one of the Labview examples for continuously acquiring data inside a simple state machine. I want a single "Run" button and a single "Exit" button (which will stop the VI completely and ultimately bring them back to the main menu). The use

  • How to retrieve lost data from the reset Blackberry?

    Hi all, I accidentally reset my Blackberry curve 8250 when i wasnt sober and all my phone contacts, sms and notes were lost. basically i use my bb as a note pad so there were many info saved on the phone. i didnt do any backup before, but i really wa