bala
file reader
0 Answer(s)      2 years and 6 months ago
Posted in : Swing AWT

import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField;

import javax.swing.SwingUtilities; import java.awt.*; import java.awt.event.*;

import javax.swing.*; import javax.swing.border.*; import java.io.FileReader;

  public class gui extends JApplet {

{

 final JTextPane pane = new JTextPane();


    JFrame frame = new JFrame("filedemo");
    frame.setVisible(true);
    frame.setSize(200,200);

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 


    JLabel label = new JLabel("Enter the filename with file path:");


    JLabel label2= new JLabel("Press the button");

    JPanel panel = new JPanel();
    frame.add(panel);
    panel.add(label);
    panel.add(label2);



    JButton b1 = new JButton("file1");
    panel.add(b1); 


    JButton b2 = new JButton("file2");
    panel.add(b2); 

    JButton b3 = new JButton("Quit");
    panel.add(b3);

    JLabel label1= new JLabel("Supervisor");
    panel.add(label1);

    JLabel label3= new JLabel("Student");
    panel.add(label3);




    // button to insert an icon
    final ImageIcon icon11 = new ImageIcon("bluepaw.gif");
    JButton iconButton1 = new JButton(icon11);
    iconButton1.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        pane.insertIcon(icon11);
      } 
      });

}

}

hi friend,i am using eclipse software.my question is :how to write filepath for JButton.and also how to open that filepath .Thanking in advance.bala

View Answers









Related Pages:
file reader
file reader  import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import..._ON_CLOSE); JLabel label = new JLabel("Enter the filename with file path
Java file byte reader
Java file byte reader  I am looking for an example program in Java for reading the bytes. More specifically I need java file byte reader example code... example for Reading file into byte array Reading a File into a Byte Array
PDF reader in android - JavaMail
PDF reader in android  Hi, iam trying to open and perform basic operations on PDF file in android. But i unable to get it. IS there any possibilities to solve that problem? Waiting for reply
Java Buffered Reader
based on a predefined size... Eg : If the 1st line of the text file... need to do this for a file with 11 lines. Here's my code while((line... the first line is being read from the text file and displays the output as desired
Java IO Reader
using Reader and FileReader. To read the contents of file used the read...Java IO Reader In this section we will discuss about the Reader class in Java. Reader class is an abstract class in java.io package provided for reading
JSP Buffered Reader
to read a text file using the Buffered Reader class. You can see in the given... JSP Buffered Reader          JSP Buffered Reader allows the user
File Reader example in JRuby
File Reader example in JRuby   ... to Read File in JRuby. We can read and write file on the console  or in a file with the JRuby. Here in our example we are reading a text file and printing
Java file line reader
Java file line reader In this section, you will learn how to read a particular line from file. Sometimes you want to read a particular line from the file but you have to read the whole file for this process. So in order to remove
Barcode reader
Barcode reader  hi all, i wont to operation in the out put from Barcode reader. dose java support Barcode reader`s result
Line Number Reader Example
Line Number Reader Example      .... In this example we are reading a file from system .Then we are reading number of lines in this file. FileReader class provides readLine() method.The 
Gobits Reader
Gobits Reader       Gobits Reader is a lightweight, web-based news reader on steroids, combined with a powerful blog creator. They are also supplying a built-in webmail that is one
barcode reader using jsp
barcode reader using jsp  HI ALL, I need jsp code for barcode reader.When we scan the barcode image that barcode value will be stored in one textbox automatically. please helpe me. Regards Bhanu
Buffered Reader.. - Java Beginners
Buffered Reader..  Hi Friend doubt On BufferedReader bf=new BufferedReader(new InputStreamReader(System.in)); CAN u Please Explain the (Every Word) Above Statement in Detail.... BufferedReader => InputStreamReader
barcode reader using java script
barcode reader using java script  Hai all, I need code for one application in java and java script my requirement is, Scanning data directly into a field is the easiest of all implementations. The cursor is placed
How to convet reader to double? - Java Beginners
How to convet reader to double?  I have this set of coding which read the input from the com1 port. I wan to ask how to convert the input (the reader.../a")) { SimpleRead reader = new SimpleRead
URL Connection Reader
URL Connection Reader       In this section, you will learn about the url connection reader. Here, first of all we are going to define class named "
Show Image Reader and Image Writer by MIME Type
Show Image Reader and Image Writer by MIME Type... the Image Reader and Image Writer by by MIME Type.  To show the image reader and image writer by MIME Type, we have used ImageIO class of the package
Show Image Reader and Image Writer by image format
Show Image Reader and Image Writer by image format... to display the Image Reader and Image Writer by the image format.  To show the image reader and image writer, we have used ImageIO class of the package
Parsing The XML File Using JDOM Parser in JSP
build() method to build a document object from a reader, InputStream, URL, File... Parsing The XML File Using JDOM Parser in JSP... from files, network sockets, strings, or from reader. JDOM does not has its own
Reading string from file timed
Reading string from file timed  So I want to make a file reader/ buffered reader that reads a new line of the textfile, lets say every 30 second. Like it reads the first line, waiting 30 seconds, read the next line and so one
Hibernate Annotations
part. The reader must have hands on experience before starting... the transformation of data from POJO to database tables and vice versa. Most commonly XML file... into the POJO java file along with the code this helps the user to understand the table
External file reading in jsp
External file reading in jsp  i have written a jsp page(ReadExt.jsp) in my application which reads a text file content from a system... file. It uses BufferedReader class to read that particular file. <%@ page
External file reading in jsp
External file reading in jsp  i have written a jsp page(ReadExt.jsp) in my application which reads a text file content from a system...; The given code reads the given file. It uses BufferedReader class to read
Java file not found exception
Java file not found exception This section illustrates you the concept of file... by a code. When a file with the specified pathname does not exist, file not found exception will occur either by your code or by the JVM. File names are case
Mobile RMS Reader 0.5.1
Mobile RMS Reader 0.5.1     ...://www.cumminsonline.com.ar/eclipse/mobile-rms-reader/mobileremsreader.zip ...-rms-reader/index.htm        
Java check end of file
Java check end of file In this section, you will learn how to check that the file has been read till the end of file. Data has been read one by one from the file. The loop is used to continually read the file until there are no more
RSS View
; RSS View is a news reader for RSS and Atom feeds designed to integrate... is a tiny plugin (~6KB) that opens a selected file in the folder of the native file manager. It adds "Explore in File System" to the context menu of Eclipse's
How to Read a File in Java
(file); // Get data from this file // using a file reader... // read via File Reader String data =""; // Read br and store a line...How to Read a File in Java? In this section we are going to know, How to read
Java file exception
Java file exception This section illustrates you the concept of file exception... or it is generated by a code.  In the given example, we have specified a file in order to read it but the system couldn't find the file and throws an exception
read restricted pdf file
read restricted pdf file  i have restricted file. package Encryption; import java.io.*; import java.util.*; import com.lowagie.text.*; import...(); document.open(); PdfReader reader = new PdfReader("C
read restricted pdf file
read restricted pdf file  i have restricted file. package Encryption; import java.io.*; import java.util.*; import com.lowagie.text....(); document.open(); PdfReader reader = new
File I/O - Java Beginners
File I/O  How to search for a specific word in a text file in java...[]){ String searchString = args[1].toLowerCase(); try { File fileName = new File(args[0]); if(fileName.isFile()) { BufferedReader reader = new
Read PDF file
Read PDF file Java provides itext api to perform read and write operations with pdf file. Here we are going to read a pdf file. For this, we have used... document = new Document(); document.open(); PdfReader reader = new
File Handling In Java
File Handling in Java In this section we will discuss about the file handling in Java. This section describes you about how to perform file handling in Java. In this section you will read what is file handling in Java, how to perform
Java read file line by line
Java read file line by line In this section, you will learn how to read a file line by line. Java has provide several classes for file manipulation. Here we are going to read a file line by line. For reading text from a file it's better
File I/O - Java Beginners
File I/O  Suppose a text file has 10 lines.How do I retrieve... and send a text file as argument. ============================== import...[]){ try { File fileName = new File(args[0]); if(fileName.isFile
Java read latest file
Java read latest file Java provides IO package to perform file operations. Here we are going to read the last modified file. For this, we have used... have got the file name that was at the last. Then using the BufferedReader class
File
File  How to create .Exe file in jana
file
file  how can copy the information in the file to the string?   Store file data into String
file
file  Could anyone please help me to write a code that does the following: Opens a file named MyName.txt, reads the first line from the file and displays it, and then closes the file. Thank you so much
Read File in Java
Read File in Java This tutorial shows you how to read file in Java. Example discussed here simply reads the file and then prints the content on the console. File handling is important concept and usually programmer reads the file line
file
file  how can add the information to the graphic file
file
file  Hi,what can delet some of the information of the file
file
file  Hi,how can delet some of the information of the file
File
File   How to find all files in our local computer using java
FILE
FILE  There is a file named Name.txt that contains information related to appliances.I want to read the contents of this file and I used the code... args[]) { try { File file=new File("Name.txt"); FileReader f=new FileReader(file
file
file  hi i want read special line of file. what am i doing ? I write... read data from file. please help me! void maketree(BtNode root,int i) throws... at the following link: Read specific line from file
How To Read File In Java with BufferedReader
How To Read File In Java with BufferedReader class - example code This tutorial shows you how you can read file using BufferedReader class in your program. This tutorial is using the BufferedReader class for reading simple text file
Write Hello in the pdf file
Write Hello in the pdf file     ...;Hello" word in a pdf file irrespective of the fact whether it exists...*, and com.lowagie.text.*. These two package will help us to make and use pdf file in our program. Now

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.