file reader

Ads

 
 

Share on Google+Share on Google+

bala
file reader
0 Answer(s)      6 years and 11 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

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
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
Advertisements
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
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
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
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
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
com.pixelmed.dicom.DicomException: No reader for jpeg-lossless available
com.pixelmed.dicom.DicomException: No reader for jpeg-lossless available   com.pixelmed.dicom.DicomException: No reader for jpeg-lossless available
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
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
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
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
Version of com.graphhopper>graphhopper-reader-gtfs dependency
List of Version of com.graphhopper>graphhopper-reader-gtfs dependency
Version of com.graphhopper>graphhopper-reader-json dependency
List of Version of com.graphhopper>graphhopper-reader-json dependency
Version of com.graphhopper>graphhopper-reader-osm dependency
List of Version of com.graphhopper>graphhopper-reader-osm dependency
Version of com.graphhopper>graphhopper-reader-shp dependency
List of Version of com.graphhopper>graphhopper-reader-shp dependency
Version of com.graphhopper>graphhopper-reader-overlay-data dependency
List of Version of com.graphhopper>graphhopper-reader-overlay-data dependency
Version of com.rgi-corp>graphhopper-reader-json dependency
List of Version of com.rgi-corp>graphhopper-reader-json dependency
Version of com.rgi-corp>graphhopper-reader-shp dependency
List of Version of com.rgi-corp>graphhopper-reader-shp dependency
Version of com.rgi-corp>graphhopper-reader-osm dependency
List of Version of com.rgi-corp>graphhopper-reader-osm dependency
Maven Dependency graphhopper-reader-gtfs >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-gtfs version0.9.0-RC1 in your project
Maven Dependency graphhopper-reader-osm >> 0.8.2
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.8.2 in your project
Maven Dependency graphhopper-reader-json >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-json version0.9.0-RC1 in your project
Maven Dependency graphhopper-reader-osm >> 0.8.0
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.8.0 in your project
Maven Dependency graphhopper-reader-osm >> 0.8.0-RC2
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.8.0-RC2 in your project
Maven Dependency graphhopper-reader-osm >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.9.0-RC1 in your project
Maven Dependency graphhopper-reader-shp >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-shp version0.9.0-RC1 in your project
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 "

Ads

 
Advertisement null

Ads