• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Can knowledge of Java Swing be helpful in non-java things ?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For example, if you know C++, learning Java becomes a little bit easier. If you know java, learning dot net becomes very easy. So, your knowledge of
one thing can be useful in another. So, its not a complete waste of time.

In the same way, can the knowledge of Swing be useful elsewhere ?

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many GUI frameworks work with the same principles as Swing, for example in the way that events such as button clicks or other interactions with the GUI are handled: you have some object that represents a button, and you can set an event handler on it which is called when the button is clicked. So if you've seen how Swing works, that may help in understanding how other GUI frameworks in Java or even in other languages work. On the other hand, the same concepts might be implemented in a different way in other GUI frameworks, so you'll have to be aware of the differences too.
 
Bartender
Posts: 1464
32
Netbeans IDE C++ Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems like a mixed bag, to me. The more you know about anything, the greater your knowledge-base with which to approach something new. But, broad experience can breed false expectations. Just because another library resembles Swing in some ways, doesn't mean it will resemble it in others and, if you unconsciously start to expect similarities that don't exist, your prior knowlege may lead you into frustrating conflicts between what you expect and what you have.

I've been doing some work at a very entry level with VB.NET. Like Swing, VB.NET doesn't want you to make calls to its GUI objects from foreign threads. Now, if you know why Swing objects ought not to be called from off the EDT, when you run into that aspect of VB.NET, you say, "Oh, sure, that makes sense." Further, you discover that, unlike Java, VB.NET is so intertwined with its GUI objects that it actually detects and prevents foreign threads from making these illegal calls. Tracking down the error messages, you find that something akin to "InvokeLater" is part of the solution. But (and this is where I have already hit my limit in VB.NET, for the moment), the prohibition is not against calls to GUI objects from off the "main" thread (the EDT, in the case of Swing), but against calls to GUI objects from outside the thread that created them. The implication, I believe, is that a worker thread can, in fact, create its own GUI objects and update them safely. I've never tried that in Swing (someone who has, please tell us if it's safe), but, right away, I see that practices I have developed while using Swing might not be fully applicable to VB.NET's GUI tools.

I guess my short answer would be: Yes, knowlege of Java Swing can be helpful in non-java things, but keep your eyes open and don't presume anything.
 
Do you want ants? Because that's how you get ants. And a tiny ads:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic