• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Platform dependency of AWT

 
Satish Kumar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Certain classes of AWT are platform-specific unlike swings.
How is that java is said to be platform-independent.
If i write a program using AWT classes(that make use of
native code) and develop it on windows NT platform,
then is it possible to port to some other platform like
solaries,Unix..
Bye
satish
m_sat@usa.com
 
paul wheaton
Trailboss
Pie
Posts: 21390
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the same code, only the components will look different on different platforms.
 
Satish Kumar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx a lot for ur reply.
Do u mean that if we use swings, the appearance
will be same on all platforms?
What is the difference between Portability
and Platform-independence?
 
paul wheaton
Trailboss
Pie
Posts: 21390
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Swing, your stuff will look more consistant between platforms. Swing is almost all lightweight components (non system dependent) and AWT is almost all heavyweight components (system dependent).
I think portability is the same as platform independence.
 
Satish Kumar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Using RandomAccessFile class, we
can create a binary file. Since,
the created file,say out.txt, in
the binary format, I can't open
it in notepad and see the output.
How can I create an ASCII file?
B'cos I've developed a program for
generating prime numbers. Since,
the output is very long, I would
like to see the output later. So,
I want to store the output in an
Ascii file. How to do it?
Bye
Satish Kumar
m_sat@usa.com
 
paul wheaton
Trailboss
Pie
Posts: 21390
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using a Writer? As in FileWriter?
 
Satish Kumar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx. I'll try that.
Bye
satish
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic