Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

How to display text in tabular form in AWT?

Posted on 2002-06-05
7
Medium Priority
?
324 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

647 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