This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Secretes Of Java........ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Secretes Of Java........" Watch "Secretes Of Java........" New topic
Author

Secretes Of Java........

Prasad Ballari
Ranch Hand

Joined: Sep 23, 2000
Posts: 149
Hi,
Can anybody tell me why Java is So famous inspite of so tedious to write code.
I wrote one program by making use Swings just to draw two Command Buttons.The code is so lengthy that i felt annoyed.If u make use of VB its just fraction of moment.
Can anybody tell me why java is sooooo lengthy.
< The program i tried>
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import javax.swing.text.*;
import java.awt.Color;
import java.awt.event.*;
import java.awt.*;

class JxFrame extends JFrame
{
public JxFrame(String title)
{

super(title);
setCloseClick();
setLF();


}
private void setCloseClick()
{
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);

}


});


}
private void setLF()
{
String laf=UIManager.getSystemLookAndFeelClassName();

try
{

UIManager.setLookAndFeel(laf);

}
catch(UnsupportedLookAndFeelException exc)
{

System.err.println("Unsupported ="+ laf);
}
catch(Exception exc)
{
System.err.println("Error loding..."+ laf);
}


}
}
public class SimpleJFC extends JxFrame
{
JButton cmdOk,cmdQuit;
JPanel jp;
Color c;

public SimpleJFC()
{
super("Simple JFC");
c=Color.yellow;
setGUI();

}

private void setGUI()
{
jp=new JPanel();
getContentPane().add(jp);

cmdOk=new JButton("OK");
cmdQuit=new JButton("Quit");


jp.add(cmdOk);
jp.add(cmdQuit);

setSize(new Dimension(250,100));
setVisible(true);

}
public static void main(String[] args)
{
SimpleJFC j=new SimpleJFC();

}
}

Regards
Prasad

------------------
Arpitha Reddy
Greenhorn

Joined: Oct 04, 2000
Posts: 20
It is true that the code you have given is very lengthy but that would work on Windows, Unix(all flavours) and many more.
No separate development teams...enormous cost savings..it is a bit slow though due to it's interpreted nature.
On the server side, you have technologies like EJB, Servlets and JSP which provide application server framework difficult to find in any other platforms. Developing enterprise applications in java takes much lesser time compared to C/C++/cgi/perl etc and the products are scalable.
The language itself has many more useful features compared to C++ or VB like threading, networking and database access.
Ever tried developing a C++ library for a dbms ? or coding a multithreaded application ? By using java, you are to a good extent insulated from the operating system...you don't have to know the operating system internals in most cases.
In a nutshell, java is not just language it is a platform. It may not be perfect yet but has more promise than any other language or platform developed to date.
More importantly, java is where money is..compare salaries of VB developers to Java developers :-)

[This message has been edited by Arpitha Reddy (edited October 12, 2000).]
Prasad Ballari
Ranch Hand

Joined: Sep 23, 2000
Posts: 149
Arpitha,
Thank you very much for your answer yaar.
Prasad

------------------
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Secretes Of Java........
 
Similar Threads
JTextField in JScrollPane
Marcus Mock #59
GridLayout Manager Doubt
Threads with A GUI
Khalid exam