sentence
stringlengths
1
1.38k
label
stringclasses
3 values
Um... having done some pretty extensive Swing across multiple platforms, I can tell you that it very much is not the same across platforms.
p
Similar?
o
Sure.
o
Same?
o
No way.
o
thanks a lot skiphoppy...
o
The heavyweight/leightweight problems will disappear with Java 6 update 12 (see URL_http://java.dzone.com/news/a-farewell-heavyweightlightwei) .
n
Wow.
p
I can't believe they can fix it, and I still can't believe mixing lightweight and heavyweight components would ever be desirable.
p
But it's incredible that they can fix it.
o
Just forget about both.
o
Have a look at WPF.
o
:).
o
The base difference that which already everyone mentioned is that One is weight** and other is weight**.
o
Let me explain, bacially what the term heavy weight means is that when you are using the awt components the native code used for getting the view component generated by the Operating System**, thats why it the look and feel changes OS to OS.
n
Where as in swing components its the responsibility of to generate the view for the components.
o
Another statement which i saw is that is MVC based and awt is not.
o
.
o
actually Swing uses a Model-Delegate approach, which is derived from the MVC approach, where in the View and Controller are combined for a Delegate structure.
o
+1 for more simpler explanation.
p
URL_http://dn.codegear.com/article/26970 [Swing-vs-AWT] .
o
Basically AWT came first and is a set of heavyweight UI components (meaning they are wrappers for operating system objects) whereas Swing built on top of AWT with a richer set of lightweight components.
n
Any serious Java UI work is done in Swing not AWT, which was primarily used for applets.
o
are there any cases where awt is more useful/ advised to use then swing?
o
Samiksha, make that another question instead of trying to have a discussion thread in these comments.
o
:).
o
It used to be relevant... 10 years ago.
o
@Pacerier he was talking about AWT, not SWT.
o
As far as when AWT may be more useful than Swing - you may be targeting an older JVM or platform that doesn't support Swing.
o
This used to really come into play if you were building Applets - you wanted to target the lowest common denominator so people wouldn't have to install a newer Java plugin.
n
I'm not sure what the current most widely installed version of the Java plugin is - this may be different today.
o
some people prefer the native look of AWT over Swing's 'not quite there' platform skins.
p
(There are better 3rd party native looking skins than Swing's implementations BTW) Lots of people preferred using AWT's FileDialog over Swing's FileChooser because it gave the platform file dialog most people were used to rather than the 'weird' custom Swing one.
n
1.
o
Swing is part of the java foundation classes.
o
2.
o
Swing components are platform-independent.
p
3.
o
Swing components are lightweight components because swing sits on the top of awt.
p
1.
o
AWT is called the abstract window tool.
o
2.
o
AWT components are platform-dependent.
n
3.
o
AWT components are heavyweight components.
n
.
o
AWT occupies more memory space2 .
n
AWT is platform dependent3 .
o
AWT require javax.awt package .
o
Swing occupies less memory space2 .
n
Swing component is platform independent3 .
o
Swing requires javax.swing package .
o
Difference between Swing and AWTSeveral consequences result from this difference between AWT and Swing.
o
AWTis a thin layer of code on top of the OS, whereas Swing is much larger.Swing also has very much richer functionality.
o
Using AWT, you have toimplement a lot of things yourself, while Swing has them built in.
o
ForGUI-intensive work, AWT feels very primitive to work with compared to Swing.Because Swing implements GUI functionality itself rather than relying on thehost OS, it can offer a richer environment on all platforms Java runs on.AWT is more limited in supplying the same functionality on all platformsbecause not all platforms implement the same-looking controls in the sameways.Swing components are called "lightweight" because they do not require anative OS object to implement their functionality.
p
JDialog and JFrame areheavyweight, because they do have a peer.
o
So components like JButton,JTextArea, etc., are lightweight because they do not have an OS peer.
p
A "peer" is awidget provided by the operating system, such as a button object or an entryfield object.
o
swing component provide much flexible user interface because itfollow model view controller(mvc).
p
awt is not mvc based.
o
swing works faster.
p
awt does not work faster.
p
swing componets are light weight.
o
awt componentsare heavy weight.
n
swing occupies less memory space.
n
awt occupies more memory space.
n
swing component is platform independent.
o
awt is platform dependent.
o
swing require javax.swing package.
o
awt require javax.awt package.
o
A better Java JSON library?
o
Can anyone recommend a good CODETERM1 (better than the one from URL_http://json.org/ [ URL_http://json.org/ ] )?
o
I've also found CODETERM2 , which definitely looks like an improvement, but I'm wondering if there is anything that is even better than that?
o
I have added a hyperlink to my parser in my answer ( URL_http://www.softwaremonkey.org/Code/JsonParser) .
o
One thing that'd help is to explain in which ways you want alternative to be better -- more functionality, more convenient, more efficient, better documentation or something else?
o
Yes... what is wrong with the existing ones?
o
Only thing I can think of is type-safety, but when I tried to fix that, it turned out to be impossible.
o
A lot has changed since this question was asked 2 years ago.
o
Here is a more recent benchmark of java serializers: URL_http://code.google.com/p/thrift - protobuf-compare/wiki/Benchmarking Notable: "Omitted from the first three charts: json/google-gson and scala.
p
These serializers are so slow, they would break the scale of our charts.
n
See below for the naked data.
o
"I'm using Jackson Json on an android app, which is incredibly fast, and come a very long way since this question was asked/answered.
n
One of the shortcomings of the json.org library is that it accepts unquoted strings, breaking the JSON specification.
o
At the very least, they could have included a parameter to enable strict parsing.
o
Frederick, I think your link should be in an answer, or at least mentioned in bigger text in the question.
o
"closed as not constructive by Kev".
o
Seeing all the information and activity, it does look very constructive and _perhaps_ it shouldn't have been closed so eagerly!.
p
Open questions that shouldn't be open obviously cause so much more harm than closed questions that shouldn't be closed, so let's be thankful that people err on the side of closing questions.</sarcasm>.
n
I can live with this being closed (voting to reopen, though), but please let's not delete it (it is awfully close to that).
n
A lot has changed since this question was asked 5 years ago.
o
Oracle has produced a standard JSON API (JSR 353) for Java EE 6 which is available in Maven, and the reference implementation used in Glassfish is also available in Maven.
p
@ThorbjrnRavnAndersen - consider editing top answer for Java JSON library with your comment.
o
I notice that there is also a library called URL_http://code.google.com/p /google-gson/ [google-gson] .
o
I haven't tried it yet.
o
Here's how it describes itself: Gson is a Java library that can be used to convert Java Objects into its JSON representation.
o
It can also be used to convert a JSON string to an equivalent Java object.
o
Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.
o
There are a few open-source projects that can convert Java objects to JSON.
o
However, most of them require that you place Java annotations in your classes something that you can not do if you do not have access to the source-code.
o