Results 1 to 2 of 2
Thread: Problem In Swing Components
- 07-19-2008, 09:19 PM #1Member
- Join Date
- Jul 2008
- Rep Power
Problem In Swing Components
I have no. of problems related to Swing. If you have the solution do reply to me.
MY problems are:
1) JTABLE: I want to decide the no. of rows at runtime. Actually I need to show the database entries via Table. And these entries can be any no. So How I can Do this????
2) JTABLE: Second problem with JTABLE is : whenever I write something on the Table Cells, It remains at the left most part of the cell. But I want , It should be at the Center(I try for "Center" but Its not working). More specific: I want my table to work Like the Tables in Ms EXCEL.
3) JTEXTAREA: Whenever I write something, it continues in a single line until and unless I press enter button. Can't be possible that when Boundary encounters cursor automatically move to next line(Like MS WORD); (And SAME WITH JTEXTFIELD.)
4) BUTTONGROUP: Its not working in JDK1.5. Any other alternative
- 07-19-2008, 10:23 PM #2
1 — use a DefaultTableModel in your table and then call setRowCount in the model:
DefaultTableCellRenderer renderer = (DefaultTableCellRenderer)table.getDefaultRenderer(String.class); renderer.setHorizontalAlignment(JLabel.CENTER);
How are you using it to conclude that it is "not working?"
See Lesson: Using Swing Components for more.
- By ne2000 in forum EclipseReplies: 2Last Post: 06-23-2008, 08:00 AM
- By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 11:04 PM
- By firstname.lastname@example.org in forum AWT / SwingReplies: 1Last Post: 05-31-2008, 10:06 AM
- By MacNstuff in forum AWT / SwingReplies: 1Last Post: 02-06-2008, 12:59 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 11-27-2007, 09:51 AM