Solved

How to display text in tabular form in AWT?

Posted on 2002-06-05
7
316 Views
Last Modified: 2013-12-29
How to display text in tabular form in AWT?Can i use TextArea for this? Can i update particular field in runtime, without touching other fields? Can anyone give me any suggession in designing?
0
Comment
Question by:vinaykn
  • 3
  • 3
7 Comments
 
LVL 18

Expert Comment

by:bobbit31
Comment Utility
why not use a JTable?
0
 
LVL 7

Expert Comment

by:Igor Bazarny
Comment Utility
Hi,

I would use either JTable, or several fields (TextFields) layed out using GridLayout or GridBagLayout. TextArea could also work, but update of particular field would require change of whole TextArea content.

Why don't you use swing?

Regards,
Igor Bazarny,
BrainBench MVP for Java 1
0
 

Author Comment

by:vinaykn
Comment Utility
I cant use swing because all of my customers are not having swing compatiability for their browsers.  I am not for plug-in, cos while refreshing(repainting, updating) my screen it always getting hanged. I see many in forums that many facing same problem while refreshing screen when plug-in is used.  

Here i am using Array of Labels using GridLayout in contrary to using canvas and repainting it according when an updation to particual field position.  Can anybody tell me whether i am approaching good way in choose Array of Labels instead Canvas???  I am not much aware of memomy problems.  I feel it doesnt require repainting of whole screen, just using setText() method of particular Label when any updation came.

Hope you all respond.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 7

Expert Comment

by:Igor Bazarny
Comment Utility
Hi,

I would say that using Canvas would meam more work, but labels would probably be a bit slower and consume a bit more memory. Typically, this is not the issue. Take care of label sizes/scrolling: what are you going to do if text doesn't fit into existing label? You may reserve enough space in advance, relayout pane when necessary or use disabled textfields--they provide rudimentary scrolling capabilities, if I'm not mistaken.

Regards,
Igor Bazarny
0
 

Author Comment

by:vinaykn
Comment Utility
Thanks for suggestion Bazarny.  Though its not a issue, how come labels become bit slower?  I thought, repainting canvas everytime instead setting text to label is easy. I am not sure which can be more slower.  Size/scrolling things are ok as per my application.  Will Disabled textfields give more flexibility than labels?  Need more suggestions and comments, i need to finalise my desite. Thanks for all.
0
 
LVL 7

Accepted Solution

by:
Igor Bazarny earned 200 total points
Comment Utility

Well, you can repaint only necessary region of canvas, so it's possible to get comparable to labels repaint performance. When you have a lot of labels, each of them uses a bit of memory, and a bit of repaint processing, especially when you need to repaint the whole applet (e.g. when it was covered by another window). If scrolling is not an issue, textfield is not better than label, otherwise textfield would scroll when user moves focus to it and moves caret.

Regards,
Igor Bazarny
0
 

Author Comment

by:vinaykn
Comment Utility
Thanks for discussion Bazarny.  I stick to Array of labels than canvas.  I find more flexibility while updating the particular field.  Here textfiled is not an issue, as my application doesnt need special attributes like scrolling etc. Still you have anything to comment on memory point of view, you are always welcome, though i close this question.  Thanks again for your suggestions.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now