/* * Main.java * * Created on 3 Απρίλιος 2008, 3:26 μμ * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package binary; import javax.swing.JOptionPane; /** * * @author students */ public class Main { static String input(){ return JOptionPane.showInputDialog(null, "Give me a number: "); } /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { String in=input(); String y; int x=Integer.parseInt(in); y=Integer.toBinaryString(x); int z=Integer.parseInt(y); System.out.print(y); JOptionPane.showMessageDialog(null,"binary form of" ); JOptionPane.showMessageDialog(null,x); JOptionPane.showMessageDialog(null,"is" ); JOptionPane.showMessageDialog(null,z); // TODO code application logic here } }