JTable with row header plus value extraction from headers

Hi, I am trying to do the following:
Short Version-
1. Create a table that has both row and column headers
2. Allow the user to mouse over any of these headers such that doing so will display an image I have produced on a panel. (I already know how to create the image and how to display it, I'm just not sure how to associate it with a particular row or column header)
3. Make the row headers look as much as possible like the column headers.
Slightly Longer Version-
Column headers will be labled A-H (maximum) while row headers will be labled 1-12 (maximum). Either can be less, however, depending on user input. After the table has been realized, the user will move the mouse over say, header 'H' and when they do, a JPEG image will appear on another panel and a tooltip will appear above the cell showing a formula. This happens when either row or column headers are moused over.
Currently, I am using the following code from the O'reilly Swing book as a baseline for experimentation but any help you can offer will be appreciated. I'm fairly new to the JTable world... :-(
TableModel tm = new AbstractTableModel(){
               String data[] = {"", "a", "b", "c", "d", "e"};
               String headers [] = {"Row #", "Column1", "Column2", "Column3", "Column4", "Column5"};
               public int getColumnCount(){ return data.length;}
               public int getRowCount() { return 1000;}
               public String getColumnName(int col){ return headers[col];}
               public Object getValueAt(int row, int col){
                    return data[col] + row;
          //creates a column model for the main table. This model ignores the first
          //column added and sets a minimum width of 150 pixels for all others
          TableColumnModel cm = new DefaultTableColumnModel(){
               boolean first = true;
               public void addColumn(TableColumn tc){
                    if(first) {first = false; return;}
                    tc.setMinWidth(150);
                    super.addColumn(tc);
          //Creates a column model that will serve as the row header table. This model
          //picks a maxium width and stores only the first column
          TableColumnModel rowHeaderModel = new DefaultTableColumnModel(){
               boolean first = true;
               public void addColumn(TableColumn tc){
                    if(first) {
                         tc.setMaxWidth(tc.getPreferredWidth());
                         super.addColumn(tc);
                         first = false;
          JTable grid = new JTable(tm, cm);
          //set up the header column and hook it up to everything
          JTable headerColumn = new JTable(tm, rowHeaderModel);
          grid.createDefaultColumnsFromModel();
          headerColumn.createDefaultColumnsFromModel();
          //make sure the selection between the main table and the header stay in sync
          grid.setSelectionModel(headerColumn.getSelectionModel());
          headerColumn.setBorder(BorderFactory.createEtchedBorder());
          headerColumn.setBackground(Color.lightGray);
          headerColumn.setColumnSelectionAllowed(false);
          headerColumn.setCellSelectionEnabled(false);
          JViewport jv = new JViewport();
          jv.setView(headerColumn);
          jv.setPreferredSize(headerColumn.getMaximumSize());
          //to make the table scroll properly
          grid.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
          //have to manually attach row headers but after that, the scroll pane
          //keeps them in sync
          JScrollPane jsp = new JScrollPane(grid);
          jsp.setRowHeader(jv);
          jsp.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER, headerColumn.getTableHeader());
          gridPanel.add(jsp, BorderLayout.NORTH);

There a number of nice examples on JTable: http://www.senun.com/Left/Programming/Java_old/Examples_swing/SwingExamples.html
Hope you could find something suitable ...
Regards,
Anton.

Similar Messages

  • How to print jTable with custom header and footer....

    Hello all,
    I'm trying to print a jTable with custom header and footer.But
    jTable1.print(PrintMode,headerFormat,footerFormat,showPrintDialog,attr,interactive)
    does not allow multi line header and footer. I read in a chat that we can make custom header and footer and wrap the printable with that of the jTable. How can we do that..
    Here's the instruction on the chat...
    Shannon Hickey: While the default Header and Footer support in the JTable printing won't do exactly what you're looking for, there is a straight-forward approach. You can turn off the default header/footer and then wrap JTable's printable inside another Printable. This wrapper printable would then render your custom data, and then adjust the size given to the wrapped printable
    But how can i wrap the jTable's Printable with the custom header and footer.
    Thanks in advance,

    I also once hoped for an easy way to modify a table's header and footer, but found no way.
    Yet it is possible.

  • AutoPopulating a field with a string plus value from another field

    Hi: I have a table with two fields
    create table LINKREQUEST (
    requestid int primary key,
    INCIDENT_NUMBER varchar2(16),
    REQUESTID is auto populated using a sequence. I want to auto populate the INCIDENT field with the string "INC" plus the value from REQUESTID. Can someone help.
    TIA
    Ravi

    REQUESTID is auto populated using a sequence. I want to auto populate the INCIDENT field with the string "INC" plus the value from REQUESTIDSomething like this?:
    SQL> create table linkrequest (
    requestid int primary key,
    incident_number varchar2(16)
    Table created.
    SQL> create sequence linkrequest_seq
    Sequence created.
    SQL> create or replace trigger linkrequest_trg before insert on linkrequest
    for each row
    begin
    select linkrequest_seq.nextval,
            case when :new.incident_number = 'INC' then 'INC' || linkrequest_seq.nextval else :new.incident_number end
       into :new.requestid, :new.incident_number from dual;
    end;
    Trigger created.
    SQL> insert into  linkrequest (incident_number) values ('XY')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('INC')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('VW')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('INC')
    1 row created.
    SQL> select * from linkrequest
    REQUESTID INCIDENT_NUMBER
             1 XY             
             2 INC2           
             3 VW             
             4 INC4           
    4 rows selected.

  • Print Jtable with multiline header?

    i want to print jtable with multi-lines header and footer
    using the print function that takes MessageFormat as header and footer
    i used MessageFormat header = new MessageFormat("hello\r\nworld");and i used '\n' only
    but it was printed all in the same line
    thnx in advance

    You can try something on the below lines. Set your custom renderer for the tableheader.
    public class MultiLineHeaderRenderer extends DefaultTableCellRenderer{
            public Component getTableCellRendererComponent(JTable table, Object value,
                             boolean isSelected, boolean hasFocus, int row, int column) {
                         JLabel label = (JLabel) super.getTableCellRendererComponent( table,  value,
                              isSelected,  hasFocus,  row,  column);
                        label.setText("<html>a<br>b</html>");
                        return label;
        }Not the best way to do it. And might need to some modifications too to set the font position etc.

  • Print a JTable with several Header and Footers

    Hi everybody,
    my name is Lothar and I come from Germany. My english is not very well, but I hope you understand me an my problem.
    I want to print a JTable, but I want to print a header with several headers and footers.
    For example:
    h3. Header
    h5. 1. Subtitle
    h5. 2. Subtitle
    Table
    h5. 3. Subtitle
    h5. Footer
    But, I do not know how I can do that. Can anybody tell me, how I can solve my problem. Please, explain for a newbie because I have learned Java since two months ;)
    Here the code:
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import java.util.Date;
    import javax.swing.*;
    public class Beispiel extends JFrame implements ActionListener {
        private JTable table;
        public static void main(String[] args) {
            Beispiel tl = new Beispiel();
            tl.setVisible(true);
            tl.pack();
        public Beispiel() {
            setLayout(new BorderLayout());
            // DruckButton
            JButton print = new JButton("Print");
            add(print, BorderLayout.SOUTH);
            print.addActionListener(this);
            // Tabelle
            add(new JScrollPane(createTable()), BorderLayout.CENTER);
            // schlie&szlig;t das Frame
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        public JTable createTable() {
            // titel
            String[] title = new String[] { "Datum", "Von", "Bis",
                    "Dauerinsgesamt", "Bemerkung" };
            // daten
            String[][] data = new String[][] { { "", "", "", "", "" },
            table = new JTable(data, title);
            table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            return table;
        public void actionPerformed(ActionEvent e1) {
            MessageFormat header = new MessageFormat("Header");
            MessageFormat footer = new MessageFormat("Footer");
            try {
                table.print(JTable.PrintMode.FIT_WIDTH, header, footer);
            } catch (Exception e2) {
                System.err.format("Cannot print %s%n", e2.getMessage());
    }

    Nobody?
    Can nobody solve my problem?

  • Print JTable with row headers

    I am using the fancy new printing capablities in java 1.5 to print my JTable and wow is it ever slick!
    PrintRequestAttributeSet set = new HashPrintRequestAttributeSet();
    set.add(OrientationRequested.LANDSCAPE);
    this.matrixJTable.print(JTable.PrintMode.NORMAL, null, null, true, set, false);Its just that easy. Way to go sun!
    The one problem that I am encountering is that my row headers don't print. The problem is that JTables don't support row headers, you have to use a JScrollPane for that.
    I need a way to print my JTable so that the row headers show up in the printout... and hopefully still use the warm and fuzzy new printing capabilities of JTable printing in java 1.5.
    (ps/ Isn't it time to add row header support to JTables?)

    The problem is that JTables don't support row headers, you have to use a JScrollPane for that.Well technically JTable's don't really support column headers either. It is a seperate component (JTableHeader). A JTable will automatically add its table header to the table header area of a JScrollPane. (but you don't have to use a jscrollpane to see the column headers, it is just the quickest and easiest way).
    Really shouldn't be hard to implement a row header and manually add it to the scroll panes row header area or use a BorderLayout and put your row header in the WEST and put your table in the CENTER if you don't want a scroll pane.
    Of course this won't help you with your printing issue.

  • JTable with Groupable Header

    Hi again, Im have problems with a JTable supporting Groupable Header
    check this code please:
    public class GroupableHeaderExample extends JFrame {
      GroupableHeaderExample() {
        super( "Groupable Header Example" );
        DefaultTableModel dm = new DefaultTableModel();
        dm.setDataVector(new Object[][]{
          {"119","foo","bar","ja","ko","zh"},
          {"911","bar","foo","en","fr","pt"}},
        new Object[]{"SNo.","1","2","Native","2","3"});
        JTable table = new JTable( dm ) {
          protected JTableHeader createDefaultTableHeader() {
         return new GroupableTableHeader(columnModel);
        TableColumnModel cm = table.getColumnModel();
        ColumnGroup g_name = new ColumnGroup("Name");
        g_name.add(cm.getColumn(1));
        g_name.add(cm.getColumn(2));
        ColumnGroup g_lang = new ColumnGroup("Language");
        g_lang.add(cm.getColumn(3));
        ColumnGroup g_other = new ColumnGroup("Others");
        g_other.add(cm.getColumn(4));
        g_other.add(cm.getColumn(5));
        g_lang.add(g_other);
        GroupableTableHeader header = (GroupableTableHeader)table.getTableHeader();
        header.addColumnGroup(g_name);
        header.addColumnGroup(g_lang);
        JScrollPane scroll = new JScrollPane( table );
        getContentPane().add( scroll );
        setSize( 400, 120 );  
      }it could be like this :
    * |-----------------------------------------------------|
    * |        |       Name      |         Language         |
    * |        |-----------------|--------------------------|
    * |  SNo.  |        |        |        |      Others     |
    * |        |   1    |    2   | Native |-----------------|
    * |        |        |        |        |   2    |   3    | 
    * |-----------------------------------------------------|
    * |        |        |        |        |        |        |
    */but it is looking like this:
    * |-----------------------------------------------------|
    * |  SNo.  |   1    |    2   | Native |   2    |   3    | 
    * |-----------------------------------------------------|
    * |        |        |        |        |        |        |
    */its look like correct, but i think the problem is in one of the clases called. what do you think? ... thanks
    Message was edited by:
    iTzAngel
    Message was edited by:
    iTzAngel

    STOP SPAMMING THE FORUMS!
    http://forum.java.sun.com/thread.jspa?threadID=5202466
    http://forum.java.sun.com/thread.jspa?threadID=5202411
    http://forum.java.sun.com/thread.jspa?threadID=5202439
    http://forum.java.sun.com/thread.jspa?threadID=5202369
    by the way, you are really spamming the forums

  • JTable: Resizable Row Header

    Hi,
    Did anyone implement a row header class for JTable that allows to resize rows (the height of rows) like JTableHeader does for columns?

    Take a look at the link shown below:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=252175
    ;o)
    V.V.

  • Sortable jtable with jcombo having different values

    Hi,
    I have a contacts list with name, addrerss etc., and telephone numbers where each contact can have several telephone numbers.
    The data is stored in a Derby DB in two tables with a PK and FK relationship. I need to load all the Contact fields in to a JTable where one of the columns will be the JCombos with telephone number(s) for that paticular contact.
    I have studied two neat sample code segments posted by a senior mrmber "camickr" at;
    [http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637581 |http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637581 ]
    Also another by " skdaga " at;
    [http://forums.sun.com/thread.jspa?threadID=749031&messageID=4284078|http://forums.sun.com/thread.jspa?threadID=749031&messageID=4284078]
    both are solid working examples.
    My problem is that I need to let the user to sort the table by columns and also filter by a text box entry. Meaning, the Combo boxes cannot have a fixed row index.
    Could someone advice if this is possible or I should use some other approach.
    Thanking you in advance,

    Hi camickr;
    Many thanks for your kind reply. I have managed to slightly modify your code to load the combos of individual telephone numbers dynamically.
    I have done so by returning a TableCellEditor from the public TableCellEditor getCellEditor(int row, int column) method, in place of storing the
    DefaultCellEditor dce1 = new DefaultCellEditor( comboBox1 ); etc., in an ArrayList.
    It goes as this. Following method is called by the return statement.
    private TableCellEditor createCellEditorWithCombo(int contactId) {
            JComboBox cmbNumbers = new JComboBox( <passed a Vector here thro' a PreparedStatement from the DB>);
            DefaultCellEditor editor = new DefaultCellEditor(cmbNumbers);
            return (TableCellEditor)editor;
        }The contactId of course could be easily desiphered from the "row" parameter then and there.
    I will follow your advice on the sorting part (on which I am yet to read the API fully) and get back with the result. Btw, I use the JDK 1.6u7 with Netbeans 6.1
    Thanking you once again for your great contributions,
    ViKARLL
    NB: By the way;
    camickr wrote:
    Well, if you look at my example you will note it uses the convertColumnIndexToModel(...). So you need to do the same thing for the row.It looks like you are referring to a diffrent post by you, since your example I worked on does not contain this method ??
    Edited by: ViKARLL on Sep 13, 2008 4:19 AM

  • Updating a JTable with an array of values

    Ther is a constructor that allows for the cretion of the table with an iniital array of values. However subsequent updates of blocks of data- say you received an array of updated data form a database- reuiqre you to update ince cell at a time. Is ther any way fo updating a whole block at once. I should point out that I am asking this because I am using JTables in the Matlab programming environment where arrays are the basic unit and looping through is a comparatively slow process

    Yes, you can extend the AbstractTableModel and write a method for updating a whole block.
    lets say you've got a Vector with Float[] arrays as elements to hold a 2D array of Float. The you could write:
          TableModel dataModel = new AbstractTableModel() {
                public int getColumnCount() { return col_names.size(); }
                public int getRowCount() { return data.size();}
                public Object getValueAt(int row, int col) {
                   return ((Float)((Float[])data.elementAt(row))[col]).toString();
                public String getColumnName(int col) {
                 return ((String)col_names.elementAt(col));
                public Class getColumnClass(int col) {
                 return String.class;
                public boolean isCellEditable(int row, int col) {
                  return true;
                public void setValueAt(Object aValue, int row, int col) {
                   try {
                     Float fv = Float.valueOf((String)aValue);
                    ((Float[])data.elementAt(row))[col] = fv;
                   } catch (Exception ex) {
                public void setBlock(Float block[][], int row, int col) {
                   // copy the Arrays with System.arrayCopy into data
          };PS: I don't know, if the above is correct written, havn't test this. But I hope you can recognize the idea behind it.
    wami

  • Print jTable with a header and footer panel

    Hi Folks,
    I'm currently at a sticking point in a project I'm playing around with. I have a data set of around 300 objects that i'd like printed out in a table. Now, I've gotten the display part down without a hitch but printing the data as well as a header panel and footer panel has been eluding me. I'd basically like something like this...
    Name: some name Order date: some date
    Address: some address Shipped To: some address
    somewhere Some city, some state, etc
    in some city
    Date | Title | Etc | Etc | Etc
    date1 title1 5 $3.00 $15.00
    date1 title1 5 $3.00 $15.00
    date2 title1 5 $3.00 $15.00
    date2 title1 5 $3.00 $15.00
    Total purchases: $60.00
    Total Items: 20
    # of Orders: 2
    Am I barking up the wrong tree by making the first and third sections panels and the second section a table? If not, how the heck do I accomplish this? Most of the time the table has been multiple pages as well - I only need section one on the first page and section three on the last page, but whatever is easiest really.
    My current approach has been basically to make a custom printables, print the first section, figure out how high it was, print the second section and hope for the best, but the third would never show up because it'd never go over two pages.
    Any help would be very much appreciated.
    Thanks,
    Stephen
    Edited by: stephenliberty on May 7, 2009 9:11 AM - more specific subject

    I suppose as a quick update, this is as far as I've gotten and will likely get-
    public class PrintForm extends JFrame implements Printable{
        JComponent headerPanelForPrint;
        JComponent footerPanelForPrint;
        JTable dataTableForPrint;
        public void setPieces(JComponent header, JTable table, JComponent footer){
            this.headerPanelForPrint = header;
            this.footerPanelForPrint = footer;
            this.dataTableForPrint = table;
        public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
            graphics.translate((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY());
            TableFormat tableFormat;
            if(pageIndex>0){
                tableFormat = new TableFormat(0, footerPanelForPrint.getHeight());
            } else {
                headerPanelForPrint.printAll(graphics);
                tableFormat = new TableFormat(headerPanelForPrint.getHeight(), footerPanelForPrint.getHeight());
            MessageFormat footer = new MessageFormat("Page - {0}");
            Printable table = dataTableForPrint.getPrintable(PrintMode.FIT_WIDTH, null, footer);
            int printme = table.print(graphics, tableFormat, pageIndex);
            if(printme == table.NO_SUCH_PAGE){ return table.NO_SUCH_PAGE; }
            return Printable.PAGE_EXISTS;
    class TableFormat extends PageFormat {
        double footerHeight;
        double headerHeight;
        public TableFormat(double headerHeight, double footerHeight){
            this.headerHeight = headerHeight;
            this.footerHeight = footerHeight;
        @Override
        public double getImageableHeight() {
            return super.getImageableHeight() - ( this.footerHeight + this.headerHeight );
        @Override
        public double getHeight() {
            return super.getImageableHeight() - ( this.footerHeight + this.headerHeight);
        @Override
        public double getImageableX() {
            return 0;
        @Override
        public double getImageableY() {
            return this.headerHeight;
    }It works very well with just a header and the table, but I still have not been able to get a footer to show up in the appropriate spot or (preferably) on the last page.
    Edited by: stephenliberty on May 8, 2009 12:29 PM

  • Print JTable with column heading

    Hi,
    I'm very new to this JTable. I'm try to print a Jtable using the print() function (from JDK 1.5)
    JTable.print(JTable.PrintMode.FIT_WIDTH, new MessageFormat(
    _tabledata.getTitle() ),
    new MessageFormat("Page {0,number}"));
    The problem I have is that some time it print and other time it doens't print. Also, if it doesn't print, then the program become very slow or not respond. Is that the probelm with the new JDK or am I doing something wrong?
    Thanks for you help.

    Don't rely on JTable.print() methods too much.
    Sadly Sun didn't think anyone would need to print anything from java so support was added late and half heartedly (programmers hate printing stuff)
    If you are new to java you need to focus on something simpler than printing documents; unfortunatly printing is a tedious burdonsome task for experreineced developers
    for example: learn how to output your data from a table into an HTML formate/file; you can build beautiful reports/printouts easily and view them in java components easily but you will probably want to print them from a browser.
    Even if you find a class or two to help with your printing efforts on the net you will find you need to know many other generic complicated aspects of java to continue
    Sean

  • Adiing row header to J Table

    i want to add my row header dynamically when i am add a row by pressing the add button it is possible..
    and thr problem iam facing in this program is that the row header is there but along with row header a label like shade visible upto the end of frame.
    Any help over these
    And this is my code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    ]import javax.swing.table.*;
    public class RowHeaderExample extends JFrame {JTable table;  
    public RowHeaderExample()
    {        super( "Row Header Example" );    
       setSize( 300, 150 );    
       ListModel listModel = new AbstractListModel() {   
            String headers[] = {"","","","","","" };        
       public int getSize() { return headers.length; }    
           public Object getElementAt(int index) { return headers[index];
         DefaultTableModel defaultModel =            new DefaultTableModel(listModel.getSize(),10);  
          table = new JTable( defaultModel );   
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);    
       // Create single component to add to scrollpane  
    final JList rowHeader = new JList(listModel);    
       rowHeader.setFixedCellWidth(40);    
       rowHeader.setFixedCellHeight(table.getRowHeight());      
    rowHeader.setCellRenderer(new RowHeaderRenderer(table));   
        JScrollPane scroll = new JScrollPane( table ); 
          scroll.setRowHeaderView(rowHeader);
    // Adds row-list left of the table      
    getContentPane().add(scroll, BorderLayout.CENTER);   
       rowHeader.addMouseListener(new MouseAdapter() {     
         public void mouseClicked(MouseEvent e) {     
         System.out.println("click Here 1");          
    int index = rowHeader.locationToIndex(e.getPoint());
    table.setRowSelectionInterval(index,index);          
    table.requestFocus();     
    public static void main(String[] args) {     
      RowHeaderExample frame = new RowHeaderExample();      
    frame.addWindowListener( new WindowAdapter() {    
           public void windowClosing( WindowEvent e ) {       
            System.exit(0);            }        });    
       frame.setVisible(true); 

    actually i dont quite understand your problem, dont know whether this one solve your problem, i guess may be the problem come from your renderer
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class RowHeaderExample
        extends JFrame {
      JTable table;
      public RowHeaderExample() {
        super("Row Header Example");
        setSize(300, 150);
        ListModel listModel = new AbstractListModel() {
          String headers[] = {
              "Row 1", "Row 2", "Row 3", "Row 4", "Row 5", "Row 6"};
          public int getSize() {
            return headers.length;
          public Object getElementAt(int index) {
            return headers[index];
        DefaultTableModel defaultModel = new DefaultTableModel(listModel.getSize(),
            10);
        table = new JTable(defaultModel);
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        // Create single component to add to scrollpane
        final JList rowHeader = new JList(listModel);
        rowHeader.setFixedCellWidth(40);
        rowHeader.setFixedCellHeight(table.getRowHeight());
        rowHeader.setCellRenderer(new RowHeaderRenderer(table));
        JScrollPane scroll = new JScrollPane(table);
        scroll.setRowHeaderView(rowHeader);
        // Adds row-list left of the table
        getContentPane().add(scroll, BorderLayout.CENTER);
        rowHeader.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            System.out.println("click Here 1");
            int index = rowHeader.locationToIndex(e.getPoint());
            table.setRowSelectionInterval(index, index);
            table.requestFocus();
      public static void main(String[] args) {
        RowHeaderExample frame = new RowHeaderExample();
        frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
        frame.setVisible(true);
      class RowHeaderRenderer extends JButton implements ListCellRenderer{
        JTable table;
        public RowHeaderRenderer(JTable table){
          this.table = table;
          setFont(new Font("Dialog",0,11));
          setMargin(new Insets(0,0,0,0));
        public Component getListCellRendererComponent(JList list, Object value,int index, boolean isSelected, boolean hasFocus){
          list.setBackground(getBackground());
          this.setText(value.toString());
          return this;
        public Component getListCellRendererComponent(JList list, Object value, boolean isSelected, boolean hasFocus){
          list.setBackground(getBackground());
          this.setText(value.toString());
          return this;
    }

  • How to swap column-data along with Table header

    Hi All!
    I found a smple JTableDemo.java class. When I run it it provided sorting on the table as well as Dragging Column-data along with Table header while swaping two columns-headers.
    I designed my own table and apply some changes to TableModel. Afterwords it swaps Table-Headers only, but not their respective columns.
    Can someone give me a clue for that, where the logical error may be?
    Thanx in Advance

    surprised.. since you have asked, it must have some more tricky issue. Any way what i thought of it
    in before insert on table2
    simply insert into table1 (cr_id) values (:new.cr_id_id);
    i assume that table1 pk does not generated through sequence
    proposed insertion will not violate the uniqueness and create another record only in table1
    what is thehidden agenda for not using simple before insert trigger as above.
    yours
    dr.s.r.bhattachar

  • RFx Header Target Value in Sourcing  is Zero for RFx created in SRM Manually

    Hi All,
      We are facing the issue with RFx Header Target Value, before proceeding with question , like to share our scenario's
    We are using SAP SRM Classical Strategic Scenario.  and below are two possible ways.
      Case1)ECC PR - SRM SC (EXTR-BUS2121) - SRM RFx(BUS2200) - SRM RFx Response(BUS2202) - > ECC PO.
      Case2)ECC PR - SRM SC (EXTR-BUS2121) - SRM RFx(BUS2200) - SRM RFx Response(BUS2202) - > SRM Contract - ECC Contract.
      Case3) SRM RFx(user create RFx directly in SRM ) - SRM RFx(BUS2200) - SRM RFx Response(BUS2202) - > SRM Contract - ECC Contract.
      Case4)SRM RFx(user create RFx directly in SRM ) - SRM RFx(BUS2200) - SRM RFx Response(BUS2202) - > - > ECC PO.
       Now for cases  1 & 2 ,  Target Value in the RFx Header is populating correctly ,but  for Cases 3 & 4 where the RFx is directly created in SRM  ,the Target Value field is visible and editable in the RFx Header ,but when we enter some value and go to other tab, like bidder, the "Target Value" is getting cleared.,
      Can any help to understand this  SAP behavior of application ,Is this SAP standard? or is there is any miss in our configuration.? Kindly provide some inputs on this. I also cross checked the notes
    Thanks
    Channa

    Hello Channa,
    There is note 1992525 and 1712226.
    Please refer to the note 2037465 for important information about pricing.
    This note has all information about pricing in SRM for different scenarios.
    Best regards,
    Rohit

Maybe you are looking for

  • What's with Spotlight?

    I've never cared much for Spotlight, which is way overkill for my needs some 95% of the time. In 10.4 it was dog slow also, so I used EasyFind. In 10.5 it's faster, so I've been using Spotlight, though it's annoying that I have to manually switch to

  • Recording live audio from a Bus

    Hey, So what I'd like to do is record audio from a bus directly into an audio channel I have a test oscillator in the input slot of an instrument channel As you can see, the output is routed into bus 1 In order to process any audio that I have coming

  • Flat File Usage in XI?

    Hello, Can XI support the use of flat files?  In other words, could I replace my current Unix script based file transfer mechanism with XI and continue to use files? Or would I need to convert the file to an XML or other type of message within XI? Th

  • Oracle 11g R2 - 64 bit latest patch sets and patch list

    Hi.. I have installed oracle 11g R2 64 bit on top of windows server 2008 R2 64 bit enterprise edition... I want to install patch on oracle 11g database, please let me which is latest patch level need to be install? Rgards ananda

  • Item filed- conversion agent

    hi,   i read many blogs stating that i can use item fields conversion agent to convert edi into xml. I also read(/people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield)  in this page that i can get the appropriate