File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Suggestion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Suggestion" Watch "Suggestion" New topic


Lucky Singh
Ranch Hand

Joined: Jan 19, 2004
Posts: 125
Can you suggest to me what I should use (JTextArea...)if I want to display something in the following format-?
Student ID| Student Name
Don't need a table really.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

It would be a lot better to use a JTable for this (especially if you are planning on making this information editable by the user), but all you'd have to do is surround the data with tabs (\t) and end each row with a newline (\n). The problem occurs when one or more of your data strings exceeds the space allowed by the tabs and your columns are no longer aligned. You don't have this problem with a JTable.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Suggestion
It's not a secret anymore!