?
Solved

How to display text in tabular form in AWT?

Posted on 2002-06-05
7
Medium Priority
?
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 7059370
why not use a JTable?
0
 
LVL 7

Expert Comment

by:Igor Bazarny
ID: 7059943
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
ID: 7060888
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:Igor Bazarny
ID: 7061633
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
ID: 7066067
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 800 total points
ID: 7066380

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
ID: 7069355
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month8 days, 12 hours left to enroll

764 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