Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2008, 11:19 PM
Member
 
Join Date: Jul 2008
Posts: 20
SANDY_INDIA is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-20-2008, 12:23 AM
Senior Member
 
Join Date: Jul 2007
Posts: 1,266
hardwired is on a distinguished road
1 — use a DefaultTableModel in your table and then call setRowCount in the model:
Code:
((DefaultTableModel)table.getModel()).setRowCount(yourCount);
2 —
Code:
DefaultTableCellRenderer renderer = (DefaultTableCellRenderer)table.getDefaultRenderer(String.class); renderer.setHorizontalAlignment(JLabel.CENTER);
3 —
Code:
textArea.setLineWrap(true); textArea.setWrapStyleWord(true);
4 — I have never had trouble with ButtonGroup in j2se 1.5
How are you using it to conclude that it is "not working?"

See Lesson: Using Swing Components for more.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Components Placing ne2000 Eclipse 2 06-23-2008 10:00 AM
How to print Swing components Java Tip java.awt 0 06-23-2008 01:04 AM
Tab order on swing components ashvin@projectdemo.biz AWT / Swing 1 05-31-2008 12:06 PM
Where is it best to declare swing components? MacNstuff AWT / Swing 1 02-06-2008 02:59 AM
HTML on Swing Components Java Tip Java Tips 0 11-27-2007 11:51 AM


All times are GMT +3. The time now is 12:14 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org