JTable cell editor and row selection

I have a JTable with 8 columns and the last column is editable and has a custom table cell editor. The user can edit cells in that column or select a row and use buttons above the table to do such things as delete the row. So far so good. However if the user selects a row by clicking on a cell in the editable column and tries to delete the last row(for example) the row disappears except for the cell in the last column which is left hanging with the cursor in it.
I do a table.clearSelection(). Do I need to set the focus elsewhere in the table?
Help! and thanks.

Before you delete the row, cancel the in-process editing:
if( _table.isEditing() ) {
    _table.getCellEditor().cancelCellEditing();
// Delete the row in the model

Similar Messages

  • Custom JTable cell editors and persistence

    I have a JTable with an underlying data model (an extension of AbstractTableModel) that uses custom cell editors in the last column. The cell editor in that column, for a given row, depends on the value selected in another column of the same row. The cell editors include text, date, list, and tree editors (the last one in a separate dialogue). The number of rows is changeable.
    I have need to persist the data for a populated table from time to time, for restoration later on. I've achieved that, such that the data model is recreated, the table appears correct, and the appropriate cell editors activated (by creating new instances of the editors' classes).
    However, my problem is that the (custom) cell editors do not reflect the data in the model when editing mode is begun the first time after restoration. Eg. the text editor is always empty, the list editor shows the first item, and no node is selected in the tree editor.
    If I've restored the model correctly, should the editors properly reflect the underlying data when they are set to editing mode?
    I suspected not, and thus tried to explicitly 'set' the correct values immediately after each editor is recreated ... but to no avail.
    Does anyone have any thoughts, or experience with something similar? I'm happy to supply code.

    You can use html tags within Swing, so I think you can do the following:
    * MyRenderer.java
    * Created on 26 April 2007, 10:27
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package newpackage;
    import java.awt.Component;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.SwingConstants;
    import javax.swing.table.TableCellRenderer;
    * @author CS781RJ
    public class MyRenderer extends JLabel implements TableCellRenderer
        public MyRenderer()
            setHorizontalTextPosition(SwingConstants.RIGHT);
            setIconTextGap(3);
            setOpaque(true);
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean cellHasFocus, int row, int column)
            if (isSelected)
                setBackground(table.getSelectionBackground());
                setForeground(table.getSelectionForeground());
            else
                setBackground(table.getBackground());
                setForeground(table.getForeground());
            if (value instanceof String)
                if ((value != null) && (value.toString().length() > 0))
                    System.out.println("Value: " + value.toString());
                    setFont(new java.awt.Font("Tahoma", 0, 11));
                    setText("<html>" + value.toString().replaceAll("\n", "<br>") + "</html>");
            return this;
    }In the class that has the JTable, use the code AFTER declaring the values, columns, etc:
    jTable1.getColumnModel().getColumn(0).setCellRenderer(new MyRenderer());
    jTable1.setValueAt("Riz\nJavaid", 0, 0);One thing I haven't done is to resize the cell heights, make sure this is done.
    Hope this helps
    Riz

  • Custom JTable cell editor problem

    I have a custom JTable cell editor which is a JPanel with 2 JtextFields, One for a name, the other for a data value. My problem lies in when the the cell is selected and then the user start typing. The JTextfield outline shows up, but there is no carat. I can only edit the cell when I click the mouse in it again. I have my isCellEditable method set to only allow editing on 2 mouse clicks, but I did try it with just returning true and had the same problem. Please help.
    Code:
    class cellValue {
    String name;
    String data;
    Color nameColor;
    Color dataColor;
    Font font;
    public cellValue(String n, String d, Color nC, Color dC, Font ff){
    name = n;
    data = d;
    nameColor = nC;
    dataColor = dC;
    font = ff;
    } //end class
    public class TextFieldCellEditor extends JPanel implements TableCellRenderer, TableCellEditor{
    private EventListenerList listenerList = new EventListenerList();
    private ChangeEvent event = new ChangeEvent(this);
    private cellValue s;
    private int e_row=0;
    private int e_col=0;
    private JTextField ta;
    private JTextField tb;
    public TextFieldCellEditor() {
    setLayout(new GridBagLayout());
    ta = new JTextField();
    tb = new JTextField();
    tb.setHorizontalAlignment(SwingConstants.RIGHT);
    add(ta, new GridBagConstraints(0,0,1,1,0.6,0.0,java.awt.GridBagConstraints.WEST,java.awt.GridBagConstraints.BOTH,new Insets(0,1,0,0),0,0));
    add(new JLabel(" "),new GridBagConstraints(1,0,1,1,0.1,0.0,java.awt.GridBagConstraints.WEST,java.awt.GridBagConstraints.BOTH,new Insets(0,1,0,0),0,0));
    add(tb, new GridBagConstraints(2,0,1,1,0.3,0.0,java.awt.GridBagConstraints.EAST,java.awt.GridBagConstraints.BOTH,new Insets(0,1,0,0),0,0));
    } //end init
    public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected,
    boolean hasFocus,int row, int column) {
    s = (cellValue)value;
    e_row = row;
    e_col = column;
    ta.setText(s.name);
    tb.setText(s.data);
    ta.setFont(s.font);
    tb.setFont(s.font);
    ta.setForeground(s.nameColor);
    tb.setForeground(s.dataColor);
    setForeground(table.getForeground());
    setBackground(table.getBackground());
    ta.setBackground(table.getBackground());
    tb.setBackground(table.getBackground());
    ta.setCaretColor(Color.WHITE);
    tb.setCaretColor(Color.WHITE);
    return (JComponent)(this);
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    return (getTableCellRendererComponent(table, value,isSelected, true, row, column));
    public boolean isCellEditable(EventObject e) {
    if (e instanceof MouseEvent) {
    return ((MouseEvent)e).getClickCount() >= 2;
    } return true;
    // return true;
    public boolean shouldSelectCell(EventObject anEvent) {
    return (true);
    public void cancelCellEditing() {
    public boolean stopCellEditing() {
    fireEditingStopped();
    return (true);
    public Object getCellEditorValue() {
    return (ta.getText());
    public void addCellEditorListener(CellEditorListener l){
    try {
    SwingUtilities.invokeLater(
    new Runnable() {
    public void run() {requestFocus();}
    } catch (Exception e) {};
    listenerList.add(CellEditorListener.class, l);
    public void removeCellEditorListener(CellEditorListener l) {
    listenerList.remove(CellEditorListener.class, l);
    protected void fireEditingStopped(){
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2)
    ((CellEditorListener)listeners[i+1]).editingStopped(event);
    protected void fireEditingCanceled() {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2)
    ((CellEditorListener)listeners[i+1]).editingCanceled(event);
    } //end class

    Thanks again for the repley.
    I tried removing the celleditorlistener and using the setSurrenderFocusOnKeystroke, but it did not work. The textfield is editable;
    I did change:
    public void addCellEditorListener(CellEditorListener l){
    try {
    SwingUtilities.invokeLater(
    new Runnable() {
    public void run() {ta.requestFocus();}
    } catch (Exception e) {};
    listenerList.add(CellEditorListener.class, l);
    }This allows the first textfield to request focus and this seems to work. But when I highlight a cell, then start typing, the first character I type puts me into the editor, but it is lost. Example:
    I type hello
    and get ello in the cell. Then when I press enter the input is excepted and the selection goes to the next cell, but I cannot move the Highlight cursor at all, seems locked. The only way I can continue to the next cell is to use the mouse.
    You said you had a cell editor working. Would you care to share as an example. This is killing me to get this to work properly.
    Thanks again
    Dave

  • Tab transversal while using JTextArea as a JTable cell editor..

    I'm working on a project that will use a JTable with a JTextArea cell editor to create a chart for classroom scheduling. Searching on Google, I found a way to use a JTextArea as a cell editor and render the cell properly. However, when editing a cell, pressing the Tab key inserts a tab, rather than leaving the cell and going to the next one, as happens with just a regular JTable. In fact, none of the keyboard shortcuts that work on a JTable work once the JTextArea cell editor is used. Does anyone know of any way to resolve this? Below is some code I'm using to create a sample GUI, just to verify that I can do this. Another question is would it be easier to use a bunch of JLabels and JTextAreas, remove the padding from those JTextAreas, and try to allow for Tab transversals between stand-alone JTextAreas, rather than JTextAreas as JTable cell editors?
    Thanks!
    package edu.elon.table;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class GUI
         private JFrame frame;
         private String[] columnNames = {"Classroom", "8:00-9:10", "9:25-10:35",
              "10:50-12:00", "12:15-1:25", "1:40-2:50", "1:40-3:20 (MW)",
              "3:35-5:15 (MW)", "5:30-7:10 (MW)"};
         private Object[][] data = {columnNames,
              {"ALAM 201 (42)\nENG 110 LAB", "", "", "", "", "", "", "", ""},
              {"ALAM 202 (42)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 203 (38)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 205 (40)\n", "", "", "", "", "", "", "", ""},
              {"ALAM 206 (39)\nSINK, TV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 207 (40+)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 214 (38)\nTV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 215 (42)\nTV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 216 (42)\n", "", "", "", "", "", "", "", ""},
              {"ALAM 301 (40)\nTV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 302 (38)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 304 (35)\nFRENCH", "", "", "", "", "", "", "", ""},
              {"ALAM 314 (30)\nDP, PSY, COMPUTER ASSISTED", "", "", "", "", "", "",
              {"ALAM 315 (40)\nPC LAB, DP/DVD", "", "", "", "", "", "", "", ""}};
         private JTable table;
         public GUI()
              frame = new JFrame();
              table = new JTable(data, columnNames);
              table.setRowHeight(table.getRowHeight()*2);
              TableColumnModel cModel = table.getColumnModel();
              TextAreaRenderer renderer = new TextAreaRenderer();
              TextAreaEditor editor = new TextAreaEditor();
              for (int i = 0; i < cModel.getColumnCount(); i++)
                   cModel.getColumn(i).setCellRenderer(renderer);
                   cModel.getColumn(i).setCellEditor(editor);
              frame.setLayout(new GridLayout(1,0));
              frame.add(table);
              frame.pack();
              frame.setVisible(true);
    public static void main (String[] args)
    GUI gui = new gui();
    * Written by Dr. Heinz Kabutz, found through online newsletter via Google.
    class TextAreaRenderer extends JTextArea
    implements TableCellRenderer {
    private final DefaultTableCellRenderer adaptee =
    new DefaultTableCellRenderer();
    /** map from table to map of rows to map of column heights */
    private final Map cellSizes = new HashMap();
    public TextAreaRenderer() {
    setLineWrap(true);
    setWrapStyleWord(true);
    public Component getTableCellRendererComponent(//
    JTable table, Object obj, boolean isSelected,
    boolean hasFocus, int row, int column) {
    // set the colours, etc. using the standard for that platform
    adaptee.getTableCellRendererComponent(table, obj,
    isSelected, hasFocus, row, column);
    setForeground(adaptee.getForeground());
    setBackground(adaptee.getBackground());
    setBorder(adaptee.getBorder());
    setFont(adaptee.getFont());
    setText(adaptee.getText());
    // This line was very important to get it working with JDK1.4
    TableColumnModel columnModel = table.getColumnModel();
    setSize(columnModel.getColumn(column).getWidth(), 100000);
    int height_wanted = (int) getPreferredSize().getHeight();
    addSize(table, row, column, height_wanted);
    height_wanted = findTotalMaximumRowSize(table, row);
    if (height_wanted != table.getRowHeight(row)) {
    table.setRowHeight(row, height_wanted);
    return this;
    private void addSize(JTable table, int row, int column,
    int height) {
    Map rows = (Map) cellSizes.get(table);
    if (rows == null) {
    cellSizes.put(table, rows = new HashMap());
    Map rowheights = (Map) rows.get(new Integer(row));
    if (rowheights == null) {
    rows.put(new Integer(row), rowheights = new HashMap());
    rowheights.put(new Integer(column), new Integer(height));
    * Look through all columns and get the renderer. If it is
    * also a TextAreaRenderer, we look at the maximum height in
    * its hash table for this row.
    private int findTotalMaximumRowSize(JTable table, int row) {
    int maximum_height = 0;
    Enumeration columns = table.getColumnModel().getColumns();
    while (columns.hasMoreElements()) {
    TableColumn tc = (TableColumn) columns.nextElement();
    TableCellRenderer cellRenderer = tc.getCellRenderer();
    if (cellRenderer instanceof TextAreaRenderer) {
    TextAreaRenderer tar = (TextAreaRenderer) cellRenderer;
    maximum_height = Math.max(maximum_height,
    tar.findMaximumRowSize(table, row));
    return maximum_height;
    private int findMaximumRowSize(JTable table, int row) {
    Map rows = (Map) cellSizes.get(table);
    if (rows == null) return 0;
    Map rowheights = (Map) rows.get(new Integer(row));
    if (rowheights == null) return 0;
    int maximum_height = 0;
    for (Iterator it = rowheights.entrySet().iterator();
    it.hasNext();) {
    Map.Entry entry = (Map.Entry) it.next();
    int cellHeight = ((Integer) entry.getValue()).intValue();
    maximum_height = Math.max(maximum_height, cellHeight);
    return maximum_height;
    * Written by Dr. Heinz Kabutz, found through online newsletter via Google.
    class TextAreaEditor extends DefaultCellEditor
    public TextAreaEditor() {
         super(new JTextField());
    final JTextArea textArea = new JTextArea();
    textArea.setWrapStyleWord(true);
    textArea.setLineWrap(true);
    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setBorder(null);
    editorComponent = scrollPane;
    delegate = new DefaultCellEditor.EditorDelegate() {
    public void setValue(Object value)
    textArea.setText((value != null) ? value.toString() : "");
    public Object getCellEditorValue()
    return textArea.getText();
    }

    Using the KeyEvent manager and playing around with the JTextArea, I was able to get a JTable using JTextAreas as the cell editors that worked very close to the way the regular JTable works. You have to hit Tab twice to shift focus to another cell, or hit Tab once and then an arrow key. Also, Alt-Enter will allow you to enter a cell for editing. All of the changes were made to the TextAreaEditor class, which should now read as follows:
    class TextAreaEditor extends DefaultCellEditor implements KeyListener
         private int lastKeyCode;
         public TextAreaEditor(final JTable table) {
              super(new JTextField());
              lastKeyCode = KeyEvent.CTRL_DOWN_MASK;
              final JTextArea textArea = new JTextArea();
              textArea.setWrapStyleWord(true);
              textArea.setLineWrap(true);
              textArea.addKeyListener(this);
              textArea.setFocusable(true);
              textArea.setFocusAccelerator((char) KeyEvent.VK_ENTER);
              JScrollPane scrollPane = new JScrollPane(textArea);
              scrollPane.setBorder(null);
              scrollPane.setFocusable(false);
              editorComponent = scrollPane;
              delegate = new DefaultCellEditor.EditorDelegate() {
                   public void setValue(Object value) {
                        textArea.setText((value != null) ? value.toString() : "");
                   public Object getCellEditorValue() {
                        return textArea.getText();
         public void keyTyped(KeyEvent ke)
              // TODO Auto-generated method stub
         public void keyPressed(KeyEvent ke)
              if (ke.getKeyCode() == KeyEvent.VK_TAB)
                   ke.consume();
                   KeyboardFocusManager.getCurrentKeyboardFocusManager()
                             .focusNextComponent();
                   return;
              if (ke.getKeyCode() == KeyEvent.VK_TAB && ke.isShiftDown())
                   ke.consume();
                   KeyboardFocusManager.getCurrentKeyboardFocusManager()
                             .focusPreviousComponent();
                   return;
              if ((lastKeyCode == KeyEvent.CTRL_DOWN_MASK) &&
                        (ke.getKeyCode() == KeyEvent.VK_ENTER))
                   ke.consume();
                   editorComponent.requestFocus();
              else
                   lastKeyCode = ke.getKeyCode();
         public void keyReleased(KeyEvent ke)
              // TODO Auto-generated method stub
         }

  • AutoComplete JComboBox As JTable cell editor

    Hello, when I try to use AutoComplete JComboBox as my JTable cell editor, I facing the following problem
    1) Exception thrown when show pop up. - Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
    2) Unable to capture enter key event.
    Here is my complete working code. With the same JComboBox class, I face no problem in adding it at JFrame. But when using it as JTable cell editor, I will have the mentioned problem.
    Any advice? Thanks
    import javax.swing.*;
    import javax.swing.JTable.*;
    import javax.swing.table.*;
    import java.awt.event.*;
    * @author  yccheok
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
                    /* Combo Box Added In JFrame. Work as expected. */
                    final JComboBox comboBox = new JComboBox();
                    comboBox.addItem("Snowboarding");
                    comboBox.addItem("Rowing");
                    comboBox.addItem("Chasing toddlers");   
                    comboBox.setEditable(true);
                    comboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
                       public void keyReleased(KeyEvent e) {
                           if(e.getKeyCode() == KeyEvent.VK_ENTER) {
                               System.out.println("is enter");
                               return;
                           System.out.println("typed");
                           comboBox.setSelectedIndex(0);
                           comboBox.showPopup();
                    getContentPane().add(comboBox, java.awt.BorderLayout.SOUTH);
        public JTable getMyTable() {
            return new JTable() {
                 Combo Box Added In JTable as cell editor. Didn't work as expected:
                 1. Exception thrown when show pop up.
                 2. Unable to capture enter key event.
                public TableCellEditor getCellEditor(int row, int column) {
                    final JComboBox comboBox = new JComboBox();
                    comboBox.addItem("Snowboarding");
                    comboBox.addItem("Rowing");
                    comboBox.addItem("Chasing toddlers");   
                    comboBox.setEditable(true);
                    comboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
                       public void keyReleased(KeyEvent e) {
                           if(e.getKeyCode() == KeyEvent.VK_ENTER) {
                               System.out.println("is enter");
                               return;
                           System.out.println("typed");
                           comboBox.setSelectedIndex(0);
                           comboBox.showPopup();
                    return new DefaultCellEditor(comboBox);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            jScrollPane1 = new javax.swing.JScrollPane();
            jTable1 = getMyTable();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {null, null, null, null},
                    {null, null, null, null},
                    {null, null, null, null},
                    {null, null, null, null}
                new String [] {
                    "Title 1", "Title 2", "Title 3", "Title 4"
            jScrollPane1.setViewportView(jTable1);
            getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
            pack();
        }// </editor-fold>                       
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
        // Variables declaration - do not modify                    
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTable jTable1;
        // End of variables declaration                  
    }

    You need to create a custom CellEditor which will prevent these problems from occurring. The explanation behind the problem and source code for the new editor can be found at Thomas Bierhance's site http://www.orbital-computer.de/JComboBox/. The description of the problem and the workaround are at the bottom of the page.

  • JTable cell editor popup

    Hi All
    I created a CalendarPanel, which contains a combobox for months and a spinner for year and grid of JLabels to display dates.
    And, a JTable with a cell which holds a date value. I created a cell editor with JSpinner to increment or decrement date by 1, which is practically not good. So I added a button top popup the calendar and user selects the date.
    Cell editor is a JPanel with a spinner and a small JButton. The click event of this button shows a Calendar (another JPanel) in which we can select the date.
    The spinner in the cell editor and the Calendar are linked to each other so that if user clicks on the spinner to change the date, that change reflects in the calendar also, and vice versa.
    I am able to popup the calendar on top of JTable at appropriate location (exactly below the cell) and when user selects the date it changes the value of spinner and vice versa.
    With this I have two problems.
    1. When user clicks on some other area of the calendar (except spinner) the calendar should automatically disappear. Right now when user double clicks on the date it disappears.
    2. In the calendar panel when I click on combo box to select the month or on the spinner to change the year - table cell is losing its focus and stopping the cell editing, means no link with calendar and the cell. But this is not happening with the label click (I guess this is because JLabels have no focus)
    How can I solve these 2.
    Thanks in advance.

    1. When user clicks on some other area of the calendar
    (except spinner) the calendar should automatically
    disappear. Right now when user double clicks on the
    date it disappears. Add a mouse listener to the other components that updates the calendar, the setVisible(false).
    2. In the calendar panel when I click on combo box to
    select the month or on the spinner to change the year
    - table cell is losing its focus and stopping the cell
    editing, means no link with calendar and the cell. But
    this is not happening with the label click (I guess
    this is because JLabels have no focus)
    Have your cell editor extend DefaultCellEditor. In the constructor, set the editorComponent to your new calendar component. Add a mouse listener (adapter) to the editorComponent - in mouseClicked, call stopCellEditing().

  • Differrent CELL Editors and Renderers in a Column

    Is it possible to have different cell editors and renderers within a single column? I would like to have text, CheckBox and ComboBox on different rows and within the same column.
    If yes, pls point me to somthing that describes this process.

    One thing that is often overlooked,due to a poor naming choice by Sun, is that a Renderer is not forced to return this as the component that will ultimately paint the cell: the only job of a cell renderer (as per the interface TableCellRenderer ) is to provide a component to do the painting. It is free to re-used the same component as much as possible (as a memory optimization), but it can also return either JComponent out of a set of 3.
    For example:
    public class MyRenderer implements TableCellRenderer {
        private JLabel componentThatRendersFoos;
        private JLabel componentThatRendersBars;
        public void getTableCellRendererComponent(...) {
            if (whatever criterion that identifies the cell as a foo) {
                componentThatRendersFoos.setBackground(...);
                return componentThatRendersFoos;
            else if (whatever criterion that identifies the cell as a bar) {
                componentThatRendersBars.setBackground(...);
                return componentThatRendersBars;
        }And similarly for editors.
    This has the advantage to enable to configure the renderer without havingto subclass JTable.
    Edited by: jduprez on Jan 20, 2011 10:51 PM
    Here is a reference to a discussion about the mixed concepts in renderers: {message:id=9161690}

  • JPanel as a JTable Cell Editor

    I want to use a JPanel and as a JTable Cell Editor. The JPanel consists of a JTextField and a JButton. When I bring it up as an editor all works fine until I change the text field value and click on another line causing the editor to be stopped. Then my app seems to go into a processing frenzy which effectively stop me from doing anything else (the app has trouble repainting itself as well).
    I'm assuming I'm not passing an important message from the JPanel to the text field but am not sure. Has anyone had success in doing this? What am I missing?
    Thanks in advance,
    Phillip

    Looks like I was too quick off the draw in posting this.
    My problem was due to some old "expiremental" code that was processing key binding.
    Once I removed the unnecessary code all worked well.

  • Small issue with custom table cell editor and unwanted table row selection

    I'm using a custom table cell editor to display a JTree. Thing i notice is that when i select a value in the tree pop-up, the pop-up closes (as it should) but then every table row, from the editing row to the row behind the pop-up when i selected the value becomes highlighted. I'm thinking this is a focus issue, but it thought i took care of that. To clairfy, look at this: Before . Notice how the "Straightening" tree item is roughly above the "Stock Thickness" table row? When i select Straightening, this is what happens to my table: After .
    My TreeComboBox component:
    public class TreeComboBox extends JPanel implements MouseListener {
        private JTextField itemField;
        private TreeModel treeModel;
        private ArrayList<ActionListener> actionListeners = new ArrayList<ActionListener>();
        private Object selectedItem;
         * Creates a new <code>TreeComboBox</code> instance.
         * @param treeModel the tree model to be used in the drop-down selector.
        public TreeComboBox(TreeModel treeModel) {
            this(treeModel, null);
         * Creates a new <code>TreeComboBox</code> instance.
         * @param treeModel the tree model to be used in the drop-down selector.
         * @param selectedItem tree will expand and highlight this item.
        public TreeComboBox(TreeModel treeModel, Object selectedItem) {
            this.treeModel = treeModel;
            this.selectedItem = selectedItem;
            initComponents();
         * Returns the current drop-down tree model.
         * @return the current <code>TreeModel</code> instance.
        public TreeModel getTreeModel() {
            return treeModel;
         * Sets the tree model.
         * @param treeModel a <code>TreeModel</code> instance.
        public void setTreeModel(TreeModel treeModel) {
            this.treeModel = treeModel;
         * Returns the selected item from the drop-down selector.
         * @return the selected tree object.
        public Object getSelectedItem() {
            return selectedItem;
         * Sets the selected item in the drop-down selector.
         * @param selectedItem tree will expand and highlight this item.
        public void setSelectedItem(Object selectedItem) {
            this.selectedItem = selectedItem;
            String text = selectedItem != null ? selectedItem.toString() : "";
            itemField.setText(text);
            setToolTipText(text);
         * Overridden to enable/disable all child components.
         * @param enabled flat to enable or disable this component.
        public void setEnabled(boolean enabled) {
            itemField.setEnabled(enabled);
            super.setEnabled(enabled);
        public void addActionListener(ActionListener listener) {
            actionListeners.add(listener);
        public void removeActionListener(ActionListener listener) {
            actionListeners.remove(listener);
        // MouseListener implementation
        public void mouseClicked(MouseEvent e) {
        public void mouseEntered(MouseEvent e) {
        public void mouseExited(MouseEvent e) {
        public void mousePressed(MouseEvent e) {
        public void mouseReleased(MouseEvent e) {
            showPopup();
        private void initComponents() {
            setLayout(new GridBagLayout());
            itemField = new JTextField();
            itemField.setEditable(false);
            itemField.setText(selectedItem != null ? selectedItem.toString() : "");
            itemField.addMouseListener(this);
            add(itemField, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0,
                    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
        private void showPopup() {
            final TreePopup popup = new TreePopup();
            final TreeComboBox tcb = this;
            final int x = itemField.getX();
            final int y = itemField.getY() + itemField.getHeight();
            int width = itemField.getWidth() + popupButton.getWidth();
            Dimension prefSize = popup.getPreferredSize();
            prefSize.width = width;
            popup.setPreferredSize(prefSize);
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    popup.show(tcb, x, y);
                    popup.requestFocusInWindow();
        private void fireActionPerformed() {
            ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "TreeComboBoxSelection");
            for (ActionListener listener : actionListeners) {
                listener.actionPerformed(e);
        private class TreePopup extends JPopupMenu {
            private JTree tree;
            private JScrollPane scrollPane;
            public TreePopup() {
                initComponents();
                initData();
            private void initData() {
                if (treeModel != null) {
                    tree.setModel(treeModel);
            private void initComponents() {
                setFocusable(true);
                setFocusCycleRoot(true);
                tree = new JTree();
                tree.setRootVisible(false);
                tree.setShowsRootHandles(true);
                tree.setFocusable(true);
                tree.setFocusCycleRoot(true);
                tree.addTreeSelectionListener(new TreeSelectionListener() {
                    public void valueChanged(TreeSelectionEvent e) {
                        tree_valueChanged(e);
                scrollPane = new JScrollPane(tree);
                add(scrollPane);
            private void tree_valueChanged(TreeSelectionEvent e) {
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
                setSelectedItem(node.getUserObject());
                fireActionPerformed();
                this.setVisible(false);
    }My TreeComboBoxTableCellEditor:
    public class TreeComboBoxTableCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
        protected TreeComboBox treeComboBox;
        protected ArrayList<CellEditorListener> cellEditorListeners = new ArrayList<CellEditorListener>();
        public TreeComboBoxTableCellEditor(TreeComboBox treeComboBox) {
            this.treeComboBox = treeComboBox;
            treeComboBox.addActionListener(this);
        public Object getCellEditorValue() {
            return treeComboBox.getSelectedItem();
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            treeComboBox.setSelectedItem(value);
            return treeComboBox;
        public void actionPerformed(ActionEvent e) {
            stopCellEditing();
    }Any thoughts?
    Edited by: MiseryMachine on Apr 3, 2008 1:21 PM
    Edited by: MiseryMachine on Apr 3, 2008 1:27 PM

    As I said, you have to have empty context elements before additional rows will be open for input.
    For instance if you want to start with 5 rows available for input do the following to your internal table that you will bind:
    data itab type standard table of sflight.
    do 5 times.
      append initial line to itab.
    enddo.
    context_node->bind_table( itab ).
    The other option if you need n number of rows is to add a button to the table toolbar for adding more rows. When this button is pressed, you add a new context element to the node - thereby creating a new empty row in the table.

  • JTable cell editor not working

    Hello there,
    I am new to Java programming,
    I am trying to create a check box in a table cell which the user should able manipulate when the JTable is showing, the renderer is working fine but the editor is not , the overriden method getTableCellEditorComponent never gets a call, getTableCellRendererComponent does get a call and renderer works fine.
    any ideas whats wrong here ?? or what could be wrong which makes getTableCellEditorComponent not get called ?
    my renderere and editor code is like this
    package com.itrsgroup.swing.componentmanager.dockablemanager;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Font;
    import java.awt.event.ItemEvent;
    import java.awt.event.ItemListener;
    import java.util.EventObject;
    import javax.swing.AbstractCellEditor;
    import javax.swing.JCheckBox;
    import javax.swing.JTable;
    import javax.swing.SwingConstants;
    import javax.swing.UIManager;
    import javax.swing.table.TableCellEditor;
    import javax.swing.table.TableCellRenderer;
    * A cell renderer and a cell editor for rendering and editing the filters active state.
    public class ActiveCheckBoxRendererEditor extends AbstractCellEditor
    implements TableCellEditor, TableCellRenderer, ItemListener
    private Font font = new Font("Verdana", Font.BOLD, 11 );
    private JCheckBox editor = new JCheckBox("Inactive");
    private JCheckBox renderer = new JCheckBox("Inactive");
    private String strSelectedText;
    private String strNotSelectedText;
    private Color colourActive = new Color(51,153,51);
    private Color colourInActive = Color.RED;
    /** Constructor. */
    public ActiveCheckBoxRendererEditor()
    this( "Selected", "Not Selected" );
    * Constructor.
    * @param strSelText - the text to render when selected.
    * @param strNotSelText - the text to render when not selected.
    public ActiveCheckBoxRendererEditor(String strSelText, String strNotSelText)
    strSelectedText = strSelText;
    strNotSelectedText = strNotSelText;
    renderer = new JCheckBox( strNotSelectedText );
    renderer.setHorizontalTextPosition( SwingConstants.CENTER );
    renderer.setVerticalTextPosition( SwingConstants.TOP);
    renderer.setHorizontalAlignment( SwingConstants.CENTER );
    renderer.setVerticalAlignment( SwingConstants.CENTER );
    renderer.setFont( font );
    editor = new JCheckBox( strNotSelectedText );
    editor.setBackground( UIManager.getColor("Table.selectionBackground") );
    editor.setHorizontalTextPosition( SwingConstants.CENTER );
    editor.setVerticalTextPosition( SwingConstants.TOP );
    editor.setHorizontalAlignment( SwingConstants.CENTER );
    editor.setVerticalAlignment( SwingConstants.CENTER );
    editor.setFont( font );
    editor.addItemListener( this );
    @Override
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
    return editor;
    @Override
    public boolean isCellEditable(EventObject arg0)
    // TODO Auto-generated method stub
    return true;
    @Override
    public Object getCellEditorValue()
    return editor.isSelected();
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    Boolean bool = (Boolean) value;
    renderer.setSelected( bool );
    renderer.setText( bool ? strSelectedText : strNotSelectedText);
    renderer.setForeground( bool ? colourActive : colourInActive );
    if( isSelected )
    renderer.setBackground( table.getSelectionBackground() );
    else
    renderer.setBackground( table.getBackground() );
    return renderer;
    @Override
    public void itemStateChanged(ItemEvent e)
    boolean isSelected = e.getStateChange() == ItemEvent.SELECTED;
    editor.setText( isSelected ? strSelectedText : strNotSelectedText);
    stopCellEditing();
    and this is how I install it on my JTable
    ActiveCheckBoxRendererEditor cbc = new ActiveCheckBoxRendererEditor("Active", "Inactive");
    TableColumn
    activeColumn = this.getColumnModel().getColumn( 3 );
    activeColumn.setCellEditor( cbc);
    activeColumn.setCellRenderer( cbc );
    activeColumn.setPreferredWidth( 80 );
    activeColumn.setMaxWidth( 200 );
    activeColumn.setMinWidth( 80 );thanks
    Ahmed

    Is the column editable?
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.

  • How to use Jtable cell Editor

    HI,
    Here trying to populate the ImageIcon using JLabel in Jtable cell. For that I used DefaultCellRenderer. For implement the mouseListener to label I used the DefaultCellEditor. I am facing one problem here. After editing the label I selected the second row of the table, the first row image is not displaying. Can any one help on this issue?
    public class LabelCellEditor extends DefaultCellEditor {
    public LabelCellEditor(final JCheckBox checkBox) {
    super(checkBox);
    public Component getTableCellEditorComponent(final JTable table, final Object value,
    final boolean isSelected, final int row, final int column) {
    Color background = null;
    background = ColorManager.SELECTED_ROW_BGCOLOR;
    labelVal = (JLabel) value;
    labelVal.setOpaque(true);
    labelVal.setFont(FontManager.TABLE_DATA_FONT);
    labelVal.setBackground(background);
    labelPanel = new JPanel();
    labelPanel.setOpaque(true);
    labelPanel.setBackground(background);
    labelPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    labelPanel.setBorder(new EmptyBorder(5, 0, 0, 0));
    labelPanel.add(labelVal);
    return this.labelPanel;
    public Object getCellEditorValue() {
    return this.labelPanel;
    public class LabelCellRenderer extends DefaultTableCellRenderer {
    public LabelCellRenderer(final int alignment) {
    //setHorizontalAlignment(alignment);
    this.align = alignment;
    public Component getTableCellRendererComponent(final JTable table, final Object value,
    final boolean isSelected, final boolean hasFocus, final int row, final int column) {
    if (value != null) {
    if (value instanceof JLabel) {
    labelVal = (JLabel) value;
    labelVal.setOpaque(true);
    labelVal.setFont(FontManager.TABLE_DATA_FONT);
    labelVal.setBackground(background);
    labelVal.setHorizontalAlignment(this.align);
    labelVal.setBorder(new EmptyBorder(0, LRPADD, 0, LRPADD));
    JPanel panel = new JPanel();
    panel.setOpaque(true);
    panel.setBackground(background);
    panel.setLayout(new FlowLayout(FlowLayout.LEFT));
    panel.setBorder(new EmptyBorder(5, 0, 0, 0));
    panel.add(labelVal);
    return panel;
    return this;
    }

    With more than 30 postings you should know by now how to use the "Code" tags when posting code so the code reatains its original formatting and is therefore more readable.
    There is no need to create a custom editor, here is a simple example.

  • JTable Cell Editor Problems

    Hi All,
    I have a problem concerning the editing for my table. When I click on a column a dialog box opens up and the user picks the values he wants. But after he presses ok in the dialog box the user again has to press enter in the selected cell or click on another cell in the table for the selected cell to lose focus.I am using a textfield as the returning component in the getcomponent method for the the table cell editor. Is there a way I can force the textfield to register an enter automatically so it loses focus or is there another way?
    Thanks, in advance.

    this is how my code is structured:
    public class MyTableCellEditor extends AbstractCellEditor implements TableCellEditor,
         ActionListener{
         private static final long serialVersionUID = 0;
         private int clickCountToStart = 2; // Default value is double click
         private JFrame editingFrame;
         // This is the component that will handle the editing of the cell value
         JTextField txtresult = new JTextField(10);
         String result = null;
         public MyTableCellEditor(JFrame jframe){
              //txtresult.addActionListener(this);       
              editingFrame = jframe;
        public int getClickCountToStart(){
            return clickCountToStart;
        public int setClickCountToStart(int c){
            clickCountToStart = c;
             return clickCountToStart;
        public boolean isCellEditable(EventObject e){
            if(e instanceof MouseEvent){
                 if(((MouseEvent)e).getClickCount()>=this.getClickCountToStart()){
                      return true;
            return false;
        public boolean stopCellEditing(){
             fireEditingStopped();
             return true;
        // This method is called when a cell value is edited by the user.
        public Component getTableCellEditorComponent(JTable table, Object value,
                boolean isSelected, int row, int col) {
             // Make certain columns non editable
             if(table.getColumnName(col).equals("Sub Number")){
                  return null;
             else if(table.getColumnName(col).equals("Transmitter#/Receiver#")){
                  return null;
             if(table.getColumnName(col).equals("TOOLMODE")){
                  result = toolModeModify();
                 if(result==null){
                      result = value.toString();
                  if(result != null){
                      txtresult.setText(result);
                 else{
                      txtresult.setText(value.toString());
            else{
                 result = ModifyCell();
                 if(result != null){
                      txtresult.setText(result);
                 else{
                      if(value != null){
                           txtresult.setText(value.toString());
             txtresult.setEditable(false);
             return txtresult;
        public void actionPerformed(ActionEvent e) {
            //stopCellEditing(); //Make the renderer reappear.
        // This method is called when editing is completed.
        // It must return the new value to be stored in the cell.
        public Object getCellEditorValue() {
             try{
                 return txtresult.getText();
             }catch(NullPointerException ne){
                  return null;
        private String toolModeModify(){
             Object[] possibilities = {"0", "1", "2","3"};
             String number = (String)JOptionPane.showInputDialog(
                                 editingFrame,
                                 "Option 0: Receiver\n"
                                 + "Option 1: UDT\n"
                                 + "Option 2: TRX/UDR\n" +
                                 "Option 3: OFF\n",
                                 "Select Mode",
                                 JOptionPane.PLAIN_MESSAGE,
                                 null,
                                 possibilities,
                                 "0");
             return number;
        private String ModifyCell(){
              String editCell = "Edit Cell Value";
              String s;
              s = JOptionPane.showInputDialog(editingFrame, editCell, null,
                        JOptionPane.PLAIN_MESSAGE);
              if(s != null){
                   return s;
              else{
                   return null;
    }I dont know what I am doing wrong.

  • JTable cell editor problem

    Hi, I have a custom cell editor component being used on my JTable (a calendar component) and am having problems bringing the component out of edit mode when selecting another cell.
    If I click on a cell it enters edit mode correctly, the I can drop a popup window out from this editor to display the calendar. If however I move to another cell this window remains active.
    Could anyone explain how to come out of edit mode when moving to another cell (not necessarily selecting just moving the mouse in to another) ?
    I also have a second problem in that the calendar editor doesn't set the value in to the cell when choosing a date from the component. It keeps the original value that was in the cell. I have implemented a setValueAt() method so I'm not sure why this is not fired, any ideas?? Code is below :
    public class DueDateTableModel extends AbstractTableModel {
        private Vector vAllDueDates = null;
        private Connection conn = null;
        private Statement stmt = null;
        private ResultSet rsDueDates = null;
        private int iColCount;
        private String sSqlDueDates = null;
        private String[] testColNames = null;
        public DueDateTableModel(int pColCount, Vector pAllDueDates, String[] pColNames){
            iColCount = pColCount;
            vAllDueDates = pAllDueDates;
            testColNames = pColNames;
            populateTableCells();
            //setupEditors();
        public int getColumnCount() {
            return iColCount;
        public int getRowCount() {
            return vAllDueDates.size();
        public String getColumnName(int iCol) {
              return testColNames[iCol];
        public Object getValueAt(int iRow, int iCol) {
            // TODO Auto-generated method stub
            Vector v = (Vector)vAllDueDates.elementAt(iRow);
            return v.elementAt(iCol);
        public void setValueAt(Object oValue, int iRow, int iCol) {
            Vector v = (Vector)vAllDueDates.elementAt(iRow);
            v.setElementAt(oValue,iCol);
            fireTableCellUpdated(iRow,iCol);
        public boolean isCellEditable(int iRow, int iCol) {
            if(getValueAt(iRow,iCol)==null){
                return false;
            }else{
                return true;
        private class DueDateEditor extends CalendarComboBox implements TableCellEditor{
            //protected EventListenerList listenerList = new EventListenerList();
            //protected ChangeEvent changeEvent = new ChangeEvent(this);
            public DueDateEditor(){
                super();
            public void removeCellEditorListener(CellEditorListener l){
                //listenerList.remove(CellEditorListener.class, l);
            public Component getTableCellEditorComponent(JTable table, Object value
                    , boolean isSelected, int row, int column){
                //Just return the input panel and not the panel that the calendar comboBox is on
                return this.inputPanel;
              public Object getCellEditorValue(){
                  return this.getDate();
              public boolean isCellEditable(EventObject evt) {
                //if (evt instanceof MouseEvent) {
                  //  return ((MouseEvent)evt).getClickCount() >= 2;
                return true;
              public boolean shouldSelectCell(EventObject anEvent){
                  return false;
              public boolean stopCellEditing(){
                  //this.setDate();
                  return true;
              public void cancelCellEditing(){
              public void addCellEditorListener(CellEditorListener l){
                  //listenerList.add(CellEditorListener.class, l);
              /*protected void fireEditingStopped() {
                  CellEditorListener listener;
                  Object[] listeners = listenerList.getListenerList();
                   for (int i = 0; i < listeners.length; i++) {
                         if (listeners[i] == CellEditorListener.class) {
                                listener = (CellEditorListener) listeners[i + 1];
                                listener.editingStopped(changeEvent);
        }Sorry the classes are quite basic, I'm not very familiar with custom cell editors, I have normally used default ones like combobox etc.
    Regards
    Alan

    To get better help sooner, post a SSCCE that clearly demonstrates your problem.
    To post code, use the code tags -- [code]Your Code[/code]will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
    luck, db

  • Cell Editor and Structures

    Hi,
    I have a requirement to use a field in a previous row of a query result in a calculation in the current row.
    My first question is, is this possible ? or does anybosy have any suggestions for a workaround
    In trying to determine if it is possible I was going to investigate the use of the Cell Editor. However this requires that I have 2 structures in my query. I have therefore created a reuseable structure for the key figures, but the structure for the characteristics does not display the characteristics selected in either the query definition or the query results. Because of this I cannot proceed with the Cell editor.
    Can any one help with defining characteristic structures ?
    Can anybody recommend a good book for BW query definition/tips/tricks ?

    Hi Bhanu.
    I am creating the structure as you say by right clicking
    on the 'rows' heading and creating a new structure.
    Then I am right clicking on the new structure and dragging and dropping the required characteristics into the structure. eg Plant and Material. I am changing the description eg 'MM Data'  Then after closing the dialog I do 'save as' to save the structure as reusable. All appears to work fine. BUT I was expecting the rows of the query to then contain Plant and Material, instead they have a heading of  'MM data' with no values for either Plant or Material showing.
    I am therefore not sure that I have grasped the point of reusable structures. Having said that, if I create one in exactly the same way for key figures then it does work  in the way I was expecting. ie The key figures contained in the structure are visible in the report.
    The actual rqmt I have is to be able to multiply 2 key figures together from separate rows in the query results. i don't think its possible, but was trying to exhaust all avenues of thought before going back to the users with alternatives. 
    Rgds
    Simon

  • [JTable] prepareRenderer() override and foreground selection setting

    Hello,
    I can't solve this problem :
    To get a JTable's cell blinking in different colors, I overrided the JTable's prepareRenderer() method : this works fine.
    "But", because there's always a butt, if I restore the cell default background and foreground color when I want the cell to stop blinking, I lose the cell selection foreground color. If I don't restore those colors, the cell selection foreground color (translucent blue) is kept, but cell background and foreground colors will remain in the last blinking state.
    Can you see why or should I submit it as a Java bug (I already read and followed other topics on cell blinking, but it doesn't cover this very point) ?
    Here is the problematic code snippet (to get this method called, I manually and regularly trigger a fireTableCellUpdated() in a thread). The alternative issue is commented in it :
            public Component prepareRenderer(TableCellRenderer renderer,int row,int column) {
                Component res;
                res = null;
                res = super.prepareRenderer(renderer,row,column);
                // conditions required to make the cell blink
                if(
                   (isRunningThreadNewLog) &&
                    (row == 0) &&
                    (column == 0)
                   (! isCellSelected(row,column))
                    res.setBackground(newItemColor[0][lastItemColorIndex]);
                    res.setForeground(newItemColor[1][lastItemColorIndex]);
                    lastItemColorIndex = (lastItemColorIndex + 1) % newItemColor[0].length;
                * Here is where the problem occurs :
                *  - if I build ans runs as it, cell selection foreground will be painted with the default translucent blue color, but cell background and foreground colors won't be reset
                *  - if I uncomment, build and run, ccell background and foreground colors will be paint, but cell forground will be lost, or exactly, it will be painted to the cell foreground color, not the cell selection foreground color
               else {
                    res.setBackground(defaultItemColor[0]);
                    res.setForeground(defaultItemColor[1]);               
                return res;
            }Thanks for help :)
    Edited by: Rockz on Mar 5, 2009 1:19 PM

    or should I submit it as a Java bugLets see, you write some custom code and it doesn't work the way you want it to, so it must be a Java bug?
    Did you ever think it might be a problem with your code?
    First of all, whats with all the brackets in the if statement? Why do you try to group the row and column test?
    So lets take a look at your code. You have 4 conditions. If any one of them fail then you will go into the "else" which automatically resets the foreground and background colors "even" if the isCellSelected() test is true.
    Basically, the isCellSelected should be a separate test. Maybe something like:
    if (! isCellSelected(...))
        if (isRunningThreadNewLog
        && row == 0
        && column == 0)
            // do something
        else
            // do something else
    }If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.

Maybe you are looking for

  • Regarding "Find My iPad"/iCloud

    Regarding "Find My iPad" , when setting up a second iCloud account, it gives me the option on or off , so do I choose "on" for iCloud or "on" on the general setting?  It wont let me turn it on for both.

  • Mobile Me Gallery isn't showing in iWeb

    I published an album to my Mobile Me account, but it doesn't show up in iWeb. The only album it shows available is one I deleted last week. My counter also will not show up.

  • A Fillable Form in pdf

    Can Coldfusion create a form/pdf that has fillable fields that can be filled out & then printed?? I've seen where it popultes a pdf form already to create a new pdf static page, but I don't want to purchase Acrobat Pro to make form fields....is that

  • How can I create multi-dimensional arrays of controls?

    I'm building a VI that will have hundreds of on/off buttons, 24 on each of 8 tabs.  I can deal with them programmatically in an array, like this: and then find which one was pushed with some XOR'ing: But what if I want two rows of 12 buttons?  Can I

  • I received an email that said I would needed to verify my acct or it would be cancelled

    I received an email that said if I didn't verify my icloud information that my acct was going to be cancelled withing 24 hours. Is this legit..