what can't you do in swing but in awt?

A

Alex Molochnikov

Swing is a superset of AWT. So, by definition, anything that you can do in
AWT, you can do in Swing.
 
C

Casey Hawthorne

First:

Some operations might be simpler in AWT!

Second:

For a resource light device (PDA, cell) you might need to use AWT
which is much lighter than Swing!

AWT - Awkward Windows Toolkit
 
A

Alex Molochnikov

The question was stated in the unqualified form: what can you do in AWT that
cannot be done in Swing. And the answer to THAT question remains: nothing.
Whether the operations might be simpler is of no consequence here, since AWT
has reduced functionality in comparison with Swing, and for this reason
alone is simpler in all respects. And AWT is, of course, lighter than
Swing - which again has nothing to do with the OP question.
 
H

Hal Rosser

You can operate in a java 1.1 environment with awt - but not with swing

Alex Molochnikov said:
The question was stated in the unqualified form: what can you do in AWT that
cannot be done in Swing. And the answer to THAT question remains: nothing.
Whether the operations might be simpler is of no consequence here, since AWT
has reduced functionality in comparison with Swing, and for this reason
alone is simpler in all respects. And AWT is, of course, lighter than
Swing - which again has nothing to do with the OP question.
 
A

Alex Molochnikov

Hal Rosser said:
You can operate in a java 1.1 environment with awt - but not with swing

Perhaps you forgot to put a smiley at the end of your statement. Otherwise
it is hard to take seriously claims of Swing deficiency in the timeframe
before Swing came into existence.
 
W

Wiseguy

Alex Molochnikov said:
The question was stated in the unqualified form: what can you do in AWT that
cannot be done in Swing. And the answer to THAT question remains: nothing.
Whether the operations might be simpler is of no consequence here, since AWT
has reduced functionality in comparison with Swing, and for this reason
alone is simpler in all respects. And AWT is, of course, lighter than
Swing - which again has nothing to do with the OP question.

Is AWT really (lighter) than Swing? I guess it depends on your definition
of lighter.

From page 3 of Sun's Mastering the JFC:

Swing is a set of mostly lightweight components built on top the AWT.
Swing provides lightweight replacements for the AWT's heavyweight components,


The introduction chapter gives a lengthy description of the history of
Swing and how it is suppose to overcome the (serious flaws) in the AWT
peer-to-peer architecture.
 
A

Alex Molochnikov

Wiseguy said:
Is AWT really (lighter) than Swing? I guess it depends on your definition
of lighter.

From page 3 of Sun's Mastering the JFC:

Swing is a set of mostly lightweight components built on top the AWT.
Swing provides lightweight replacements for the AWT's heavyweight
components,

It is. Don't be misled by the word "lightweight" in the Sun's description of
Swing. In Sun's terminology, "lightweight" means not dependent on the native
GUI components of the underlying platform, the native components being
considered "heavy". Performance and memory-wise, Swing is much heavier than
AWT.
 
R

Rogan Dawes

Alex said:
Perhaps you forgot to put a smiley at the end of your statement. Otherwise
it is hard to take seriously claims of Swing deficiency in the timeframe
before Swing came into existence.

I think it was actually a fair comment, and did not require smiley's.

The reality is that there are still Java 1.1 environments around
(Windows 95, Win98?), and if you are writing an applet, you need to
consider this.

Rogan
 
A

Alex Molochnikov

Rogan Dawes said:
I think it was actually a fair comment, and did not require smiley's.

The reality is that there are still Java 1.1 environments around
(Windows 95, Win98?), and if you are writing an applet, you need to
consider this.

I cannot imagine anyone writing for Java 1.1 env. these days - where would
one even get it from? Applets are all but extinct now, and the few that
still survive make use of Java plugin available from Sun - and it ain't 1.1.

Again, the original question was - what can be done in AWT that cannot be
done in Swing? And my answer still is: nothing.

The lifespan of this thread has already far exceeded its importance, and the
OP does not seem to care of the result of this debate either way, so I will
let you have the final word in it.
 
T

Thomas Weidenfeller

Alex said:
The lifespan of this thread has already far exceeded its importance, and the
OP does not seem to care of the result of this debate either way,

I would guess the OP got his homework question solved and will not show
up until his next home work is due.

/Thomas
 
T

Tony Morris

Alex Molochnikov said:
I cannot imagine anyone writing for Java 1.1 env. these days - where would
one even get it from? Applets are all but extinct now, and the few that
still survive make use of Java plugin available from Sun - and it ain't 1.1.

Again, the original question was - what can be done in AWT that cannot be
done in Swing? And my answer still is: nothing.

The lifespan of this thread has already far exceeded its importance, and the
OP does not seem to care of the result of this debate either way, so I will
let you have the final word in it.

Applets extinct?
What poor misinformed soul told you that?
The <applet> HTML tag is deprecated - a misinterpretation perhaps?
 
B

Bill Tschumy

Swing is a superset of AWT. So, by definition, anything that you can do in
AWT, you can do in Swing.

You can display native file dialogs in AWT that in many cases perform much
better that their Swing counterparts. This is particularly true on Mac OS X.
 
G

glin

a dumb question, can you make swing objects and awt objects work
together?
like jpanel to containt awt buttons etc..
 
G

Gerry

On a related note, is there any plans to extend the abilities of AWT?
Or is Swing supposed to be the way to go?

I would prefer to use native interface elements rather than using
something that might resemble a native control.


This is especially noticable on a Mac where the menu bar is not at the
top of the window. It's at the top of the screen.

I haven't been keeping up on the progress of Java.
Why is Swing preferred over an updated AWT?
 
A

Aleksander =?iso-8859-2?Q?Str=B1czek?=

Gerry said:
On a related note, is there any plans to extend the abilities of AWT?
Or is Swing supposed to be the way to go?

I would prefer to use native interface elements rather than using
something that might resemble a native control.

Did you tried SWT?
http://www.eclipse.org/swt/
 
L

Larry Barowski

Gerry said:
On a related note, is there any plans to extend the abilities of AWT?
Or is Swing supposed to be the way to go?

I would prefer to use native interface elements rather than using
something that might resemble a native control.


This is especially noticable on a Mac where the menu bar is not at the
top of the window. It's at the top of the screen.

System.setProperty("com.apple.macos.useScreenMenuBar", "true");
or on Java 1.4 or higher
System.setProperty("apple.laf.useScreenMenuBar", "true");
will enable that for Swing with Mac L&F.
 
G

Gerry

Larry Barowski said:
System.setProperty("com.apple.macos.useScreenMenuBar", "true");
or on Java 1.4 or higher
System.setProperty("apple.laf.useScreenMenuBar", "true");
will enable that for Swing with Mac L&F.

Okay... But why not use native interface elements rather than the way
Swing is implemented where everything is a 'skin'?

I like the idea another poster mentioned for SWT which uses native
interface elements if the platform supports it. If it doesn't then one
will be 'emulated' on that platform.

But SWT isn't built into Java.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top