Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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


Advertisement
View Answers

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
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
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
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
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
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
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
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
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
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 
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
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 can add the information to the graphic file
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   How to find all files in our local computer using java
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
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
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 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
 

 

 

DMCA.com