A e ka ndonjeri nga ju kodin per programim te nje Notepad te thjeshte ne Java?
Dhe e dyta kodin e Simple Calculator in Java?
FlashMX
A e ka ndonjeri nga ju kodin per programim te nje Notepad te thjeshte ne Java?
Dhe e dyta kodin e Simple Calculator in Java?
FlashMX
per notepad source code ne java mund te jete kjo faqe qe te duhet
http://www.planet-source-code.com/vb...=3158&lngWId=2
kurse per nje kalkulator te thjeshte mund ta gjesh kodin ne java
ne kete faqe
http://www.pscode.com/vb/scripts/Sho...=3506&lngWId=2 ose ne faqen tjeter
http://javaboutique.internet.com/Calculator/
Ndryshuar për herë të fundit nga benseven11 : 02-06-2003 më 16:27
≈♥♠♣♦≈ovguide.com/movies
Thnx lal!
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class CalculatorPanel extends JPanel
implements ActionListener
{ public CalculatorPanel()
{ setLayout(new BorderLayout());
rezultati= new JTextField("0");
rezultati.setEditable(false);
add(rezultati, "North");
JPanel pog = new JPanel();
pog.setLayout(new GridLayout(4, 4));
String butona = "789/456*123-0.=+"; /* po te duash add border*/
for (int i = 0; i < butona.length(); i++)
addButton(pog, butona.substring(i, i + 1));
add(p, "Center");
}
private void addButton(Container c, String s)
{ JButton ben = new JButton(s);
c.add(ben);
b.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{ String s = evt.getActionCommand();
if ('0' <= s.charAt(0) && s.charAt(0) <= '9'
|| s.equals("."))
{ if (start) rezultati.setText(s);
else rezultati.setText(rezultati.getText() + s);
start = false;
}
else
{ if (start)
{ if (s.equals("-"))
{ rezultati.setText(s); start = false; }
else baras = s;
}
else
{ double numrat =
Double.parseDouble(rezultati.getText());
calculate(numrat);
baras= s;
start = true;
}
}
}
public void calculate(double num)
{ if (baras.equals("+")) FlashMX+= num;
else if (baras.equals("-")) FlashMX-= num;
else if (baras.equals("*")) FlashMX*= num;
else if (baras.equals("/")) FlashMX/= num;
else if (baras.equals("=")) FlashMX= num;
rezultati.setText("" + FlashMX);
}
private JTextField rezultati;
private double FlashMX= "=";
private boolean start = true;
}
class CalculatorFrame extends JFrame
{ public CalculatorFrame()
{ setTitle("Makine Llogaritese");
setSize(200, 200);
addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent e)
{ System.exit(0);
}
} );
Container contentPane = getContentPane();
contentPane.add(new CalculatorPanel());
}
}
public class Calculator
{ public static void main(String[] args)
{ JFrame frame = new CalculatorFrame();
frame.show();
}
}
/*copy paste kete dhe ke makine llogaritese*/
Ndryshuar për herë të fundit nga Pogradecari : 11-06-2003 më 00:06
po mire more FlashMx
me bere te shkruaj gati 30 rreshta dhe nje rrofsh nuk na the
shendet e para
Te them te drejten qe kur kam ardhur ne Alb nuk kam hyre fare ne forum !
Anyway , Thnx A Lot Lal!
Bye
no prob FlashMx
dhe me thuaj perseri po pate ndonje problem ne java
I will be happy to help
shendet e para
Suksese te dyve cuna !
Nga FlashMx
Krijoni Kontakt