Skip to main content

Posts

Showing posts from January, 2013

How To Make Jar file From .java File

Follow the Below Steps for Make .jar file from Java  Creating a jar File in Command Prompt Start Command Prompt. Navigate to the folder that holds your class files: C:\>cd \mywork Compile your class(es): C:\mywork> javac *.java Create a manifest file: C:\mywork> echo Main-Class: DanceStudio >manifest.txt Create a jar file: C:\mywork> jar cvfm DanceStudio.jar manifest.txt *.class Test your jar: C:\mywork> DanceStudio.jar

Calculator in Java

This is One simple calculator using java swing so.. enjoy it.... her all buttons and textbox are put in panel so every row in calculator its separate on panel. This calculator made by me during 7th semester. Realy java is my favourite Language . so Steps for run Below code:-  1) Copy below code in notepade  2) Save this file as cal.java  3) open cmd and goto path of cal.java  4) Now Firts compile it using below command         javac cal.java  5) and run it using following cammand         java cal.java Code: File : cal.java import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.applet.*; /* <applet code="cal" width=250 height=300> </applet> */ class calc extends JFrame implements ActionListener   {    FlowLayout fl;  GridLayout gr;   JPanel p1,p2,p3,p4,p5,p6,p7,p8,p9;  JButton b[],plus,eql,minus,mul,div,ce;  JTextField t1;  int a,c,r=0;  String s="";