java - Scrolling inside a JTable cell in Swing -


i have table each cell contains image. if image size more row height, have added jscrollpane. when run application, scroll visible in each cell i'm not able scroll it.

how can it?

below code i'm using add scroll pane.

any sample code appreciated.

     private final jtable table = new jtable(model)      {      @override public component preparerenderer(tablecellrenderer tcr, int      row, int column)       {          component c = super.preparerenderer(tcr, row, column);          if(isrowselected(row))                        {              c.setforeground(getselectionforeground());              c.setbackground(getselectionbackground());                       }                     else{              c.setforeground(getforeground());              c.setbackground((row%2==0)?evencolor:getbackground());          }          jscrollpane _pane=new jscrollpane(c);          table.setrowheight(100);          return _pane;      } }; 

  1. right click on jscrollpane
  2. properties
  3. horizontal scrollbarpolicy = always
  4. vertical scrollbarpolicy = always

to able scroll right click on jtable autocreatecolumnfrommodel =false(deactivaded)


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -