• Post Reply Bookmark Topic Watch Topic
  • New Topic

Awt and swings

 
Prathiba krishnamurthy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Can both AWT and swings be used in the same program?
Thanks & Regards
Prathiba
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Prathiba krishnamurthy:
1. Can both AWT and swings be used in the same program?
Thanks & Regards
Prathiba

Ofcourse
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use them together, however, be prepared for strange behavior. AWT components are "heavyweight", meaning they are rendered by the native operating system. Swing components are "lightweight". They are created by the JVM. Heavyweight components will be drawn over lightweight components, making a mess of your gui.
 
Fernando Sanz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>> Heavyweight components will be drawn over lightweight components, making a mess of your gui.
That's the point. You can use both at the same time, but if you have a JPanel, you should use JButtons for example.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!