Question « JTable « Java Swing Q&A





1. Java Swing Table questions    stackoverflow.com

Hey guys, working on an event calendar. I'm having some trouble getting my column heads to display.. here is the code

private JTable calendarTable;
private DefaultTableModel calendarTableModel; 

final private String [] days = ...

2. Table question using groovy's swing builder    stackoverflow.com

Until now I've developed in PHP and JavaScript. I'm currently learning groovy, but unfortunately there aren't many tutorials about this language and the book, I'm currently reading (Groovy Recipes), doesn't contain ...

3. JTable Question    stackoverflow.com

I just want to ask how can I populate my Jtable using Jlist. I have created a JList using eclipse and I want to add the data to another class with ...

4. JTable question    coderanch.com

5. JTable question    coderanch.com

6. JTable question - URGENT    coderanch.com

table.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { int mouseClick = e.getClickCount(); if (mouseClick == 2) { System.out.println("DOUBLE CLICK!!!"); Point origin = e.getPoint(); int row = table.rowAtPoint(origin); System.out.println("row = " + row); // get selected file from vector File ff = (File) files.elementAt(row); System.out.println("files.elementAt(" + row + ") = " + ff); // do some stuff // then get rid of ...

7. Hard JTABLE Question    coderanch.com

I actually solved my own problem above. I created a class called "MyTableModel" that extends the AbstractTableModel, and I utilize it to update my JTable. Everything works fine except for 2 items. One, when I tell the MyTableModel to update the JTable with the following code: public void updateName(Contact contact) { Vector row = new Vector(2); row.add(contact.getName()); // Gets Contact ...

8. JTable question....again!    coderanch.com

Hi. I found the following code off of Sun's website to sort columns in a JTable by clicking the column header. The only thing that this code does not do, is sort descending. If I click the column to sort it sorts ascending, if I click the same column again, I want it to sort descending. Could someone please help me ...

9. 3 questions about JTable    coderanch.com





10. JTable question    coderanch.com

11. General question about using a JTable from another class    coderanch.com

hi guys, I'm starting to write a small application (something like a diary to keep various tasks of the day). There'll be a MainApp, with just a simple main() in it. And a DiaryApp that will call everything. So, my DiaryApp will use a MyDiaryUI class, and a TasksTableUI class. The later extends JPanel. Now, my problem is trying to display ...

12. JTable question    coderanch.com

13. Two JTable questions    coderanch.com

Hi, I've got 2 questions... 1. How can I set a vertical Header (TableHeader) on the left side? How can I set a left AND a top TableHeader? 2. How can I identify a Table Row? Is there a Way to set an ID per Row and read it out later? I'm not talking about hot to get the Row index ...

14. Jtable question    coderanch.com

15. Jtable question    coderanch.com

Hi, I am trying to do some work with Jtable but need to know if it can be done for sure before i go ahead with it. I am trying to insert some data into a database table using JTable .... Intially when it starts the Jtable needs to start with only one row and .. and it needs to needs ...

16. Question on Jtables    coderanch.com

hi, Can anybody tell me ..how can i display data in table if it has subheadings in it. For example //--------------------customar.dat-------------- ID Name ph.no Florida(45/6,Thomasvile-09) 231 Sam 55398444 534 Hone 55346674 Texas(332/3 ,Downtown-22) 122 Raseen 23454464 544 Plank 45223665 Indiana(44/2, Indianapolis-88) 53 ush 65322423 22 villy 65364546 //----------------------------------- I have the above output file. i have to convert it to table ...





17. JTable question    coderanch.com

18. A Question in JTable ...    coderanch.com

19. Basic Question about JTable    coderanch.com

20. JTable question    coderanch.com

21. JTable question    coderanch.com

22. A JTable question    coderanch.com

There is no abstraction of a single table cell; I don't think what you want to do is possible. Even if it were, surely it would make the GUI a bit inconsistent and hard to use; tables are supposed to represent data where each row contains the same type of data. Perhaps if you explained the problem somebody could suggest an ...

23. basic Question about JTable in Swing    coderanch.com

24. Question on JTable    coderanch.com

Hi Java Pals, I am very new to Java Swing. I have to create a TreeTable in Java Swing with a Parent Row having say 6 columns and its all child row having just 4 columns. like shown below Parent row: -Column1-+-Column2-+-Column3-+-Column4-+-Column5-+-Column6-+ Child row: --CloumnC1--+--CloumnC2--+--CloumnC3--+--CloumnC4--+ Can this be achived using JSwing ? Also, Can I be able to Change the Column ...

25. JTable Question    coderanch.com

Hi Jerret, This is the TableModel: public class AudioMusicalTableModel extends AbstractTableModel { private String[] columnNames = new String[] {"Musical Piece", "Artist", "Rel. Year", "CD Number", "Description"}; private int rowCount; public AudioMusicalTableModel() { rowCount = 1; } public int getRowCount() { return rowCount; } public int getColumnCount() { return columnNames.length; } // Maybe i should return a vector of empty strings here? ...

26. JTable question    coderanch.com

27. JTable question    coderanch.com

28. JTable Navigation Question    coderanch.com

29. Another JTable Navigation Question    coderanch.com

Hi again, If a column in a "JTable" has zero width, it is not visible, as demonstrated in below code snippet: javax.swing.JFrame frame = new javax.swing.JFrame("Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); javax.swing.JTable table = new javax.swing.JTable(25, 8); table.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); javax.swing.table.TableColumnModel tcm = table.getColumnModel(); javax.swing.table.TableColumn tc = tcm.getColumn(4); tc.setMaxWidth(0); tc.setMinWidth(0); tc.setPreferredWidth(0); javax.swing.JScrollPane tableScrollPane = new javax.swing.JScrollPane(table); frame.add(tableScrollPane, java.awt.BorderLayout.CENTER); frame.pack(); frame.setVisible(true); However, when using the keyboard navigation keys, ...

30. newbe jtable questions    dbforums.com

Is it possible to print text across multiple cells ie row 1 cols 3 to 10 should show "Smith". At the moment I'm just using colour to denote if a room is booked but it would be nice to show the booking name. I can obviously print inside a single cell (a day in this system) but if I want the ...

31. Simple question of JTable    java-forums.org

32. JTable Question?    java-forums.org

hi i just a quick question about a jtable here it is: i have a Jtable that is being filled with rows and column from my database. when i enter an a users username and i click delete it will delete the user from the database. the thing is it wont show the change in the jtable unless i refresh the ...

33. JTable question    java-forums.org

34. Connecting Classes On 2 Computers Question Jtable    java-forums.org

Hey, Thank you for taking the time to read my question! I set up a jtable and a seperate adding class. I then added a action listener to the jtable so that it would be informed whenever I made a change to it. It works sucessfully when performed on the same computer, however; whenever I try it from a remote computer ...

35. Question about JTable    forums.oracle.com

36. JTable questions...    forums.oracle.com

hi i am trying to create a media player for a bit of fun and i am stuck on showing a list of music files. i need it to produce a list where each item can be clicked and then that will allow me to play the song or video etc.. i have looked into JTables but i cant see how ...

37. A JTable Question?    forums.oracle.com

What "call it back" means? If you want to show the internal frame again, for example, you must just hide it. dispose(); completely erases the frame from the memory, so you need to create it again. If you are sure that your application is going to hide and show a frame frequently, just hide it by calling setVisible(false);.

38. JTable questions    forums.oracle.com

39. JTable question    forums.oracle.com

First, I suggest you study Sun's tutorial: [http://java.sun.com/docs/books/tutorial/uiswing/components/table.html] To control the columns of a table -- what columns show, their order, their width etc... Investigate the TableColumnModel. And in the future, please ask Swing questions in the Swing forum, as well as searching it first to see if your question has been asked and answered before, [http://forums.sun.com/forum.jspa?forumID=57]

40. JTable Question    forums.oracle.com

I'm using a JTable to display RPI numbers for basketball teams. One column is that team's rank in RPI (1, 2, ...). However, if I have JTable sort the table by rank, it will sort like this (assume there are 12 entries): 1 10 11 12 2 3 4 5 6 7 8 9 This is because the matrix full of ...

42. JTable Question    forums.oracle.com

I'm using a JTable to display RPI numbers for basketball teams. One column is that team's rank in RPI (1, 2, ...). However, if I have JTable sort the table by rank, it will sort like this (assume there are 12 entries): 1 10 11 12 2 3 4 5 6 7 8 9 This is because the matrix full of ...

43. JTable getVisibleRect() question    forums.oracle.com

Guys, I got this JTable. When user presses a button I need to get the row index of the table's top-first visible row. With myJTable.getVisibleRect().getY() I manage to get the y component's value, and I notice that that's always a multiple of 16. I could easily pretend that's my block increment and use it as a constant in the code (rowIndex ...

44. 2 JTable question    forums.oracle.com

1) In a default model JTable how can I deselect all selected rows or cancel any selection, since a table.deselectAll() method does not exist. 2) How can I move selection. For example when I press a down arrow button the selection should move down with one row. Any help is highly appreciated.

46. JTable Stupid question...    forums.oracle.com

Don't use a 2 dimensional array, you don't know how much data will be returned. Use a Vector of Vectors to build the DefaultTableModel. Search the Swing forum (where this question should have been posted to begin with) to find working examples of populating the default table model from a result set.

47. simple JTable question    forums.oracle.com

48. jtable question    forums.oracle.com

hey all i just wanna know...what is the most efficient way to add values from a database to a jtable....lets say i have a table in a database that have around 15000 tuple and i need to add those to a table in a jpanel....is a for loop with a body calling the method setvalueAt(Object data, int row, int column) a ...

49. JTable question    forums.oracle.com

Hello, I am trying to learn how to set up a custom table model (self taught, not for a class). For the current experiment I've copied an example from Sun's online tutorial where an array is used for the column headers, and another array is used for the data model. I am interested in replacing the data model with an ArrayList. ...

50. JTable question    forums.oracle.com

Hello. I have a program with a JList with a bunch of database tables on it in. For each different table selected on the list, a table with the field data is supposed to appear in the tabbed pane. It should change the pane to reflect which one is currently selected on the list but in mine, it doesn't. It just ...