Posts

Java Program for Converting Decimal to Binary

Hi Friends.. Today I am going to post a small program to convert any user given decimal number to its corresponding binary value. //DecimalToBinary.java import java.util.Scanner; public class DecimalToBinary {     static void decimalToBinary(int value){ int rem =0; String res = "" ; while ( value >0){     rem = value %2;       res = res + rem ;     value  /=2; } System. out .println( new  StringBuilder( res ).reverse());    }    public static void main(String[] args){     System.out.print("Enter the Decimal Value: ");     Scanner scanner = new Scanner(System. in );      int val = scanner .nextInt();     decimalToBinary(val);    } } Execute and Enjoy.. 😉

How to Use Oracle With Maven

Hi friends, we all use maven for easy and burden-free project development. Its very easy to add central jars to local repository by adding their group id, artifact id, and version as dependency. But sometime it produces burden to us if the required jar is not available at central repository. So in such case, we will have to manually install that jar to our local repository by using " maven install " command. Syntax : -    mvn install:install-file -Dfile="jar_name_alongwith_path"                                 - DgroupId="required_group_id" -DartifactId="required_artifactId"                                                - Dversion="required_version" -Dpackaging="jar"      For Example :                          mvn install:install-file  -Dfile=" C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar "                                 - DgroupId=" oracle.jdbc.driver " -Dartifac

NotePad Project in Java

Image
Hi Friends... A Notepad Project.. Suggest me if any modification and bugs are there. Feel free to query. package notepad; //NOTEPAD PROJECT  import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.undo.*; import java.awt.*; //FOR UNDO import java.io.*; import javax.swing.filechooser.FileFilter; //FOR FILE CHOOSER FOR OPEN AND SAVE MENU  import javax.swing.filechooser.FileNameExtensionFilter; //FILTER FOR FILE CHOOSER  import java.util.*; public class notepad extends JFrame implements ActionListener { public static JTextArea area; JMenuBar mb; JMenu file, edit, format, help; JMenuItem new1, open, save, saveas, exit1, find, findn, delete, got, selectA, timedate, cut1, copy1, paste1, font, vhelp, about; JCheckBoxMenuItem wordwrap; JScrollPane sp; String filename = "Untitled";// DEFAULT DOCUMENT TITLE public static UndoManager undo = new UndoManager(); public static UndoAction undoAction = new UndoAction(); boolean opened = false; Str