Home Answers Viewqa Java-Beginners Linking an Excel File with the Application tool

 
 


Abhinav Mishra
Linking an Excel File with the Application tool
0 Answer(s)      a year and 11 months ago
Posted in : Java Beginners

I have to link an excel file with a application software which I am developing.I have this code which is only able to open a Jpanel to select the file.After I select the file nothing is happening.I wanted to be able to generate a template based on the questions that are in the excel file like extracting the questions from the excel file and creating a template from it which I have to upload on the web later.could you please help me with this?

import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.filechooser.*;


public class SelectFile extends JFrame{


    public static void main(String[]args){
                    JFrame frame = new JFrame();
                    frame.setLayout(null);

                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.setTitle("Select File for Linking");
                    frame.setSize(400, 100);
                    Container container = frame.getContentPane();
                    container.setLayout(new GridBagLayout());

                    final JTextField text=new JTextField(20);

                    JButton b=new JButton("Select File");
                    text.setBounds(20,20,120,20);
                    b.setBounds(150,20,80,20);

                   // b.setText("<html><font color='blue'><u>Select File</u></font></html>");
                    b.setHorizontalAlignment(SwingConstants.LEFT);
                    //b.setBorderPainted(false);
                    //b.setOpaque(false);
                   // b.setBackground(Color.lightGray);
                    b.addActionListener(new ActionListener() {
                      public void actionPerformed(ActionEvent e){
                                JFileChooser fc = new JFileChooser();
                                fc.addChoosableFileFilter(new OnlyExt());

                                int returnval = fc.showOpenDialog(null);
                                if (returnval == JFileChooser.APPROVE_OPTION) {
                                File file = fc.getSelectedFile();
                                text.setText(file.getPath());
                                } 
                            }
                    });
                    container.add(text);
                    container.add(b);
                    frame.setVisible(true);
            }
    }
        class OnlyExt extends javax.swing.filechooser.FileFilter{
            public boolean accept(File file) {
        if (file.isDirectory()) return false;
        String name = file.getName().toLowerCase();
        return (name.endsWith(".xls"));
        }
        public String getDescription() { return "Excel ( *.xls)"; }
        }
View Answers









Related Pages:
Linking an Excel File with the Application tool
Linking an Excel File with the Application tool  I have to link an excel file with a application software which I am developing.I have this code... on the questions that are in the excel file like extracting the questions from the excel file
Linking excel file with a application tool using swing
Linking excel file with a application tool using swing  I have to link an excel file with my application software using java swing.As soon as i click on the link button a window should open for selecting the excel file(just like
How to link a excel file with a application software using java swing
How to link a excel file with a application software using java swing  I have to link an excel file with a application software which I am developing.The excel file will contain questionnaire for surveys.I have this code which
How to link a excel file with a application software using java swing
How to link a excel file with a application software using java swing  I have to link an excel file with a application software which I am developing.The excel file will contain questionnaire for surveys.I have this code which
How to link an excel file with the application software using java swing
How to link an excel file with the application software using java swing  I have to link an excel file with a application software which I am developing.The excel file will contain questionnaire for surveys.I have this code which
excel file using JDBC java.?
excel file using JDBC java.?  hey, i am a telecomm. engineer , and i am try to develop a tool which reads from a excel file and then appends the same excel file as required. i am writing my code on notepad and have successfully
importing excel file
importing excel file  Hi All I am developing a java application whre we upload a excel file in to database and all excel value should import... it is not showing real excel sheet value. please suggest good way to solve this problem
swing application to import a object in a excel
swing application to import a object in a excel  Hi sir, I want to make a swing application where I can import a object in a cell of a excel... to do it. please help. The details of the excel operation which i want to do
Excel conversion tool. - Java Beginners
Excel conversion tool.  Hi, I need a conversion tool which can convert .xls(Excel 2003) to .xlsx (Excel 2007) and vice-versa. Please suggest any links ro tools. Thank You
appfuse tool - Ant
application war file to me. With explaination coding details sir.i have...appfuse tool   I have using appfuse frame work tool and developing web application now iam doing project j2ee web application i didn't understand
excel
excel  how to read columns values of excel file in java and store in array list in java like col1 col2 2 3 1 7 7 9 then list1 have values of col1 and list2 have values of col2...  
JavaScript get excel file data
JavaScript get excel file data...; By the use of JavaScript we can get the excel file data as well. Here is the example which gets the data from the excel file with the cell and row index
Create and Save Excel File in JSP
and saving Excel file from JSP application. In this example we are going to create a new  excel sheet using JSP. Our application consists of two JSP files... Create and Save Excel File in JSP  
Javap Tool application
Javap Tool application  import java.awt.*; import java.lang.reflect.*; import java.awt.event.*; import java.awt.event.WindowListener.*; class Javap...; TextField tf; Javap(){ Frame f=new Frame(); Label l=new Label("Welcome to javap tool
how to display the excel file content in the jsp
how to display the excel file content in the jsp  How to present the content of the newly created excel file in the following jsp to the web browser...="application/vnd.ms-excel" %> <%@ page import="java.io.*" %> <
Reading And Writing Excel File
reading and writing excel file   ... org.apache.poi.poif.filesystem.POIFileSystem class is used to buffer the excel file into an object. In other words, we can say that it is used to read the excel file. After reading the excel
how to display the output of the newly created excel file
;%@ page contentType="application/vnd.ms-excel" %> <%@ page import="java.io....how to display the output of the newly created excel file  the following program will create the test.xlsx file, how can i display the content
how to display the excel file in the web browser.
how to display the excel file in the web browser.  > %@ page...="org.apache.poi.xssf.usermodel.XSSFWorkbook"%> > <%@ page > contentType="application/vnd.ms-excel" > %> <%@ page import="java.io.*" %> <% >
connect jdbc to an Excel spreadsheet
to an Excel spreadsheet file using jdbc?   Hello Friend, Follow... Excel Driver(*.xls) Select work book or excel file and Create the DSN name (e.g... of the selected excel file in the query. Thanks
Access Excel file through JDBC
Access Excel file through JDBC In this section, you will learn how to access excel file through Jdbc and display records in JTable. As you know Excel comes... and the excel file. Here the name of the worksheet is equivalent to any database
Excel - JSP-Servlet
Excel  How to export data from jsp to excel sheet. I am using struts1.2 in my application.  Hi friend, Code to data from Jsp to excel sheet. "abc.jsp" Enter XLS file name
Exception when opening a excel file in JFrame
Exception when opening a excel file in JFrame  Hello, I have a problem when trying to display a Excel file in a Jframe. The exception is like...() throws ExcelException{ JFrame frame= new JFrame("Test application
Browse Excel File Problem - Development process
Browse Excel File Problem  I am using a web application,in which i have to browse an excel file columns. It is working in my system. But if i access my application from other system through localhost, the columns are not getting
linking tree heading in javasript into a Jsp file and then jsp to struts action form
linking tree heading in javasript into a Jsp file and then jsp to struts action form  i have a tree that consists of 3 options say for example 1) aaa 2) bbb c) ccc when i click either one of them it should go
How to Retrieve Data from the database and write into excel file using Java
How to Retrieve Data from the database and write into excel file using Java  Hi, I am trying to develop an small application where i trying to retrieve Data from the database and store the details in excel file. Please can
Selecting Excel Sheet File
selecting excel sheet file       In this program we are going to select the excel sheet...;%@ page contentType="application/vnd.ms-excel" %> <
Reading an excel file into array
Reading an excel file into array  Hi, I'm trying to read in an excel file, search a column for containing key words (entered by a user) and then displaying the matching rows in a table. I'm fairly new to JavaScript. Can anyone
Insert data in Excel File from Database using JSP
developed a application to insert data  in excel file from database in JSP. We... Insert data in Excel File from Database  using JSP ... the data from database, create an excel file and data insert into newly
Eclipse Plunging/Tool
Eclipse Plunging/Tool   ... application aside of Eclipse but it can of course be used as a plugin inside... by specifying a template- and a properties-file, which is needed to define
Excel file Handling in Java
Excel file Handling in Java  Hello Sir, I am new to Java, I have Started Java Core by myself. I want to make a project which include 3-4 Excel file to handle.Please explain how to read and write Excel file in Java.Is it tough
how to use Excel Templet to write excel file using java.
how to use Excel Templet to write excel file using java.  how to use Excel Templet to write excel file using java
How to add download option for openwith and saveAs on exporting file to excel in servlet
How to add download option for openwith and saveAs on exporting file to excel... for generated .excel file to save at particular position on the system.Now as per...(); System.out.println("Your excel file has been generated!"); } catch
How to add download option for openwith and saveAs on exporting file to excel in servlet
How to add download option for openwith and saveAs on exporting file to excel... for generated .excel file to save at particular position on the system.Now as per...(); System.out.println("Your excel file has been generated!"); } catch
java to excel connectivity - Swing AWT
Excel Driver(*.xls) 5. Select work book or excel file and Create the DSN name (e.g...java to excel connectivity  give me source code to stored the value... database on the excel.  Hi Friend, Follow these steps: 1. Open Data
JSP Excel Tutorial
in a excel file.     Create cell and rows... can add values into cells  in a excel file.    ....   Create and Save Excel File in JSP In this example we
how to use Excel Template to write excel file using java
how to use Excel Template to write excel file using java  How to use Excel template to write data in that file using java
How to Create New Excel Sheet Using JSP
sheets in a excel file.  To create a excel sheet we can use third party APIs.... The java.io.InputStream class is used to create file. We are creating an excel... will write our new rajesh.xls  file. This object allows us to modify the excel
Reading and querying an Excel file in JavaScript
Reading and querying an Excel file in JavaScript  Hi, I'm trying to read in an excel file, search a column for containing key words (entered by a user) and then displaying the matching rows in a table. I'm fairly new
write excel file into the oracle database
write excel file into the oracle database  dear sir, i need the jsp code that reads the excel file and stores it into the oracle database table..and also i need the code to connect oracle database? thank u in advance
Excel file wriring using java
Excel file wriring using java  i have one predefined bill format in excel i want to append values in it using java apche POI or Jexcel i tried it but it overwrites file and lost previous contents what can i do
importing excel file and drawing multiple graphs from one excel file
importing excel file and drawing multiple graphs from one excel file  thanks a lot sir for replying with code for importing excel file... time from one excel file using different columns..and instead of passing column
download excel
download excel  hi i create an excel file but i don't i know how to give download link to that excel file please give me any code or steps to give download link
how to create an excel file using java
how to create an excel file using java  how to create an excel file using java
JSP Excel report download for .xlsx format
="application/vnd.ms-excel" pageEncoding="ISO-8859-1"%> <%response.setHeader...; The above code works fine because i am trying to save/open excel file in .xls format... the code like this <%@ page contentType="application/vnd.ms-excel
how to present the excel to the web browser in jsp
how to present the excel to the web browser in jsp  How to present the content of the newly created excel file in the following jsp to the web...="org.apache.poi.xssf.usermodel.XSSFWorkbook"%> <%@ page contentType="application/vnd.ms-excel
How to insert rows from Excel spreadsheet into database by browsing the excel file?
file?  I want to insert rows from excel sheet to database.for this i... the excel file using file browsing dialogue through form in JSP. How can i select excel file and insert rows into MSSQL database in JSP???   Have a look
connection of java file to excel file and put data from excel file into oracle db
connection of java file to excel file and put data from excel file into oracle db  how to create button on excel sheet using java swing and how we give action to that button excel sheet? how we connect excel file to java file
Import object in Excel using java swing
Import object in Excel using java swing  Hi sir, I want to make a swing application where I can import a object by clicking a button. I am using.... The details of the excel operation which i want to do by one click: in excel its
To Generate Excel
To Generate Excel  hi First of all my application uses Struts2 with Springs and hibernate and am new to all of that and my requirement... With EXCEL in it has to open up how can i achieve this pls explain
CSS CUSTOMIZATION AUTOMATION TOOL
a tool or an application. That should allow me to enter all the styles in a single...CSS CUSTOMIZATION AUTOMATION TOOL  Hi all, I need your idea to develop a tool. I will brief the scenario to you. 1, Creating website using