Posts

Showing posts from August, 2017

How To Read a text file by CharArrayReader in java

Image
Source Code: import java.io.*; public class CharArrayEx1 { public static void main(String args[]) throws Exception { File f= new File("Demo3.txt"); FileReader fR= new FileReader(f); BufferedReader bR= new BufferedReader(fR); int len=(int)f.length(); //System.out.println("length: "+len); char[] ch1=new char[len+1]; for(int j=0;j<len;j++) { int i; i=bR.read(); ch1[j]=(char)i; } CharArrayReader cR= new CharArrayReader(ch1); int k=0; while((k=cR.read())!=-1) { char ch2=(char)k; System.out.print(ch2); } } }

Trace text of two JTextField in one JTextArea in java Swing

Image
import javax.swing.SpringLayout; import javax.swing.*; import java.awt.event.*; import java.util.*; import java.awt.*; public class SwingTask1Eg extends WindowAdapter implements ActionListener {  JFrame f;  JCheckBox chkName,chkAge,chkShow;  JButton bRed,bBlue,bGreen,bShow;  JTextField tfNmae,tfAge;  JTextArea taShow;  JLabel lbl[] = new JLabel[5]; SwingTask1Eg() {  f=new JFrame("task1 Example..");  lbl[0]= new JLabel("This is lable");  lbl[1]= new JLabel("This is lable");  lbl[2]= new JLabel("This is lable");  lbl[3]= new JLabel("This is lable");  lbl[4]= new JLabel("This is lable");  lbl[0].setVisible(false);  lbl[1].setVisible(false);  lbl[2].setVisible(false);  lbl[3].setVisible(false);  lbl[4].setVisible(false);  chkName=new JCheckBox("Name: ");  chkAge=new JCheckBox("Age: ");  chkShow=new JCheckBox("Trace: ");  tfNmae= new JTextField(); ...

How To Read a text file by ByteArrayInputStream in java

Image
Code:   import java.util.*; import java.io.*; class test7 {  public static void main(String arg[])  {   try   {    System.out.println(" ");    FileInputStream fis=new FileInputStream("text.txt");    BufferedInputStream buf= new BufferedInputStream(fis);    int j;    while((j=buf.read())!=-1)    {     char c[]=new char[1024];     byte b[]=new byte[1024];     for(int i=0;i<c.length;i++)     {      c[i] = (char)j;      b[i]=(byte)c[i];     }     for(int i2=0;i2<1;i2++)     {      ByteArrayInputStream bis1 = new ByteArrayInputStream(b);      int k=0;      k=bis1...

How to make intro for YouTube voideos (Free) | Panzoid

Image
How to make intro for YouTube voideos (Free) | Panzoid By this site you can make cool intros for your youtube channel for free and if u want to convert the video to mp4 quality then,  please like my video , subscribe to my channel and press the bell icon beside subscribe button to get notification as soon as I upload any video