table « GUI « Java Swing Q&A





1. how to use tables with GUI builder    forums.netbeans.org

mistertransistor Joined: 09 Dec 2009 Posts: 36 Posted: Fri Jan 08, 2010 9:33 pm Post subject: how to use tables with GUI builder I'm still struggling to develop ...

2. How to use tables in AWT ?    coderanch.com

3. another table problem    coderanch.com

When I make changes to a cell, I can see that the value has changed in the table, but I can't retrieve the value until the selection (not focus)is no longer at that cell, but at another cell. I can change the focus to a different component, but as long as the cell selection remains, the value does not get set ...

4. Table in AWT    coderanch.com

5. help on sortable table    coderanch.com

6. about multiHeader table    coderanch.com

7. Master - Detail Tables    coderanch.com

Can someone throw some light on how to create Jtable for Master - Detail tables ?. I need to create two JTables one for master records and another for detail records. Whenever I double click on Master record , Detail table should display corressponding detail records . Do I get any example for this anywhere ?. Thanks for your help.

8. Table header, how to make it wrap around    coderanch.com

I have a table with quite long header for each column, such as "Measured Distance (ft)", "Calculated Coefficient", etc. When I display the table, it only shows part of the header, such as "Measured..". How can I make it wrap around into the second line so that it shows something like: Measured Distance (ft) or even Measured Distance (ft) Please help! ...

9. table is not redrawn    coderanch.com





10. Writing table using AWT...    coderanch.com

Well, the short answer is that it's going to be hard. Swing has a table widget, and AWT doesn't, so you're going to have to write it from scratch. Now, if it's a small table (no more than a hundred cells or so) you could probably get away with using a GridLayout and a bunch of Label objects. If it's larger, ...

11. Table Selection Lost    coderanch.com

I have an interface as shown below. There is a top level frame with a main panel. The main panel has a toolbar, and another panel with a split pane. The left pane contains a scrollpane with a JTable (diagram is showing only one column to keep this simple). The right pane contains tabs with various panels. These tabs are the ...

12. table not expand on maximization    coderanch.com

13. Change values in the header of a table    coderanch.com

14. Retrieving all table items    coderanch.com

Thanks for the suggestions Steve. I have been trying to implement the getValueAt and have it return an object which is really a test object (i.e. the item put into the selected cell was a Test object) but it comes out as an object and I am seemingly unable to convert it. This would be a problem if anyone knows how ...

15. How to know which table that is selected    coderanch.com

Hi I have two JTables in a splitpane and below I have a row of buttons. My problem is: how do I know what table the user is working on? (ie when the user hits the delete button to delete a table row)? Can it be solved without using global variables? It's the button that has focus. I have tried with ...

16. Problem with Table    coderanch.com





17. Help with a table and comparable    coderanch.com

I was reading the post and noticed someone had suggested the code at this site for a simulare problem I have as a solution to a sorting table in an applet: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting The code works great, it builds the table and yes, it sorts-kinda. The problem is two fold. I have int and Date data in my table and I need ...

18. table sorter    coderanch.com

Author table sorter Moses Herrada Greenhorn Joined: Jan 22, 2005 Posts: 11 posted Feb 20, 2005 04:45:00 0 Hi guys i have a table and i have a table model that extends DefaultTableModel. I used the table sorter codes that is provided by sun to implement my table sorter. When i click on the column name of the table, it can ...

19. Why my table's columName invisiable?    coderanch.com

20. Multiline Table (2)    coderanch.com

21. Tables    coderanch.com

22. Tables    coderanch.com

23. Tables    coderanch.com

Hi everyone, I have managed to add tables in a styled document(thanks to people at the java forum) but here is the problem. I am trying to add the table to a paginated styled document(by stas) but the thing is that the entire document always seems to be painted incorrectly. I have been trying this for quite some time and really ...

24. Some Problem with Table    coderanch.com

i want to using jTable to show my database... i have been show it using ScrollingResultSetTableModel.... it has been appear into jTable and i want to delete record that selected ... it can't work.. DATA d; String cmd="select * from mhs"; d.executeQuery(cmd); model=new ScrollingResultSetTableModel(d.getResultSet()); jTable1.setModel(model); int[] selected = jTable1.getSelectedRows(); for (int i=selected.length-1; i>=0; i--) //model.removeRow(selected[i]); System.out.println(selected[i]); for (int i=0; i

25. Easy Table    coderanch.com

I need to create a few different tables in Swing. I wish to use a 2D object array for the data and be able to press the column names for sorting. Is there a freeware table class I can use? I don't wish to use a separate table model for each table. Thanks.

26. Table sorter going nuts once added another itam    coderanch.com

Howdy, I've successfully implemented the table sorter from the sun website. Problem is when I add another item to the table - I get an ArrayIndexOutOfBoundsException.ArrayIndexOutOfBoundsException. specifying the problem at: return getViewToModel()[viewIndex].modelIndex; in public int modelIndex(int viewIndex) { return getViewToModel()[viewIndex].modelIndex; } does anyone know what might be the problem? thanks the complete error is below. java.lang.ArrayIndexOutOfBoundsException: 8 at com.jhexagon.incentive.utilities.jtable.Renderer.TableSorter.modelIndex(TableSorter.java:206) at com.jhexagon.incentive.utilities.jtable.Renderer.TableSorter.getValueAt(TableSorter.java:243) ...

27. Problem with Table.getSelectedColumn() method plz help its so urgent    coderanch.com

Im afraid whether i could understand ur question properly. But anyways it seems that you need a alert msg displayed if the second column is empty. Have a mouse released or mouse pressed function and then check whether the 2nd column is empty and alert a msg. Also remove the setPreferredWidth and place it outside the loop.

28. selecting item from a list to a table    coderanch.com

need help.i have items in a list and combo box in which i want it in such away that when item is selected from the list and combo box it goes to the table i have in a panel.i want to discard the text area i used.thanks in advance my code: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.table.*; ...

29. Didn't help much on the table stuff    coderanch.com

30. question on Table selection    coderanch.com

31. Table Header Renderer Issue    coderanch.com

TableColumn column = jTable1.getColumn("Price/Lb."); column.setHeaderRenderer(new TableHeaderIconRenderer(new ImageIcon("./images/MixedFruit.jpg"))); ... class TableHeaderIconRenderer extends DefaultTableCellRenderer { public TableHeaderIconRenderer(Icon icon) { setIcon(icon); setHorizontalAlignment(CENTER); setBorder(UIManager.getBorder("TableHeader.cellBorder")); } public Component getTableCellRendererComponent(JTable tab, Object val, boolean isSelected, boolean hasFocus, int row, int col) { setText(val!=null ? val.toString() : null); JTableHeader jth = tab.getTableHeader(); setFont(jth.getFont()); setForeground(jth.getForeground()); setBackground(jth.getBackground()); return this; } }

32. Graying out entire table.    coderanch.com

Hi, I am having an option to gray out all the components in a panel, if the FTP service is not running.I am able to gray out all the components in the panel except the table in the panel. I used setEnabled(false), for all these components, but doesn't seem to be working with table.Table still shows to be an active component.Can ...

33. table modal class problem    coderanch.com

Hi, This Ramesh kancherla. I am getting problem in tablemodel. when I click on button in a frame i am displaying joption pane. with out accept joption pane execution trace is going to jatable model ,after frame is strucking. i have debuging with break points. but with out reaching break points execution trace is going to jtable model. I am not ...

34. How to implement editable field in table to restrict to accept fixed length    coderanch.com

I tried to extend the DefaultCellEditor and created a FixedLengthTextField for the 4th column.But it is not working last editable column is accepting unlimited data. Example1.java public class Example1 extends AbstractTableModel implements ActionListener { private boolean DEBUG = true; Object[][] data = null; String[] columnNames = null; JFrame frame = new JFrame("Sample Demo"); JPanel panel1 = new JPanel(); JLabel label1 = ...

35. Deleting The Whole Table problem(Index Out Of Bounds)    coderanch.com

public class MyTable extends JFrame { private JTable inventoryTable; private JScrollPane scroll; private JMenuBar menuBar; private JPanel panel; private JSplitPane divider; private JButton deleteRowButton; private DefaultTableModel model; private RowSorter sorter; private Dimension windowSize; public MyTable() { initializeInventory(); } private void initializeInventory() { windowSize = Toolkit.getDefaultToolkit().getScreenSize(); panel = new JPanel(); deleteRowButton = new JButton("Delete Row"); menuBar = new JMenuBar(); final String[] columnNames ...

36. Header table    coderanch.com

37. Editing table    coderanch.com

I want to make my jtable editable, for every edit on a cell, i want to get a joptionpane to confirm the editing. after that i retrieve edited data with .getValueAt and i send a query UPDATE to my db and finally a firetablechanged is it correct? if it is, how to set my jtable editable?

38. creating a table    coderanch.com

sir, My questions are: 1. How can I create a JTable with providing column names and 3 empty rows? I have gone through the API but there is no such clue to create a table with this kind of information. It only provides creating a table by providing data and column names. 2. What should I do, when i want to ...

41. how to use table in gui    forums.oracle.com

Hai Everybody,I'm using net beans as my IDE,and i'm stuck ina problem whr it appears as there shod b use some wht shopping cart application.It would be grateful if somone can post a simple code example on this demonstrating a shopping cart java gui application,,selected good type and quantity and price should b isplayed while purchasing....Thnaks a lot,, Edited by: tuxz ...

42. J tables in GUI    forums.oracle.com

Hi, i created the panel in netbeans in this panel i put JTable as well as some other things such as comment area and i want to arrange the table in a way so that when the user click on one row or cell the new comment area will be generated with new comment in it ,also the new pop up ...

43. Something like GUI Table    forums.oracle.com

Hi; I have a simple questions. I wish implement a table, using GUI interface, with two columns, like this: - - - - - - - - - - - - - - Text - Text area - - - - - - - - - - - - - - Text - Text area - - - - - - ...