Home Tutorialhelp Comment help to solve below error

 
 

Comment

Ashish
help to solve below error,
May 1, 2010 at 11:34 AM

mport java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import java.io.*;


public class notepad extends JFrame implements ActionListener
{
JTextArea t;
JScrollPane p;
JMenuBar br;
JMenu m;
JMenuItem i1,i2,i3,i4;
JFileChooser f1;
public void setup()
{
setSize(800,900);
setTitle("my notepad");
br=new JMenuBar();
m=new JMenu("FILE");br.add(m);
i1=new JMenuItem("NEW");m.add(i1);
i2=new JMenuItem("open");m.add(i2);
i3=new JMenuItem("save");m.add(i3);
i4=new JMenuItem("exit");m.add(i4);

i1.addActionListener(this);
i2.addActionListener(this);
i3.addActionListener(this);
i4.addActionListener(this);

setJMenuBar(br);
t=new JTextArea();
p=new JScrollPane(t);
setContentPane(p);
setVisible(true);
show();
}
public void actionPerformed(ActionEvent e)
{ File fname;
if(e.getSource()==i1)
{
t.setText(" ");
}
if(e.getSource()==i2)
{
f1=new JFileChooser();
f1.showOpenDialog(null);
fname =f1.getSelectedFile();
try{
FileReader in =new FileReader(fname);
t.read(in.read);
}
catch(Exception e1){
///System.out.println(e1);
}
}
if(e.getSource()==i3)
{
f1=new JFileChooser();
f1.showSaveDialog(null);
fname =f1.getSelectedFile();
try{
FileWriter in=new FileWriter(fname);
t.write(write);
}
catch(Exception e1){}

}
if(e.getSource()==i4)
{
System.exit(0);
}

}

public static void main(String[] args)
{
notepad n=new notepad();
n.setup();

}
}

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Swing AWT

Help Required - Swing AWT
JFrame("password example in java"); frame.setDefaultCloseOperation...(); } }); } } ------------------------------- Read for more information. http://www.roseindia.net/java/example/java/swing/ Thanks. Amardeep 

Swing AWT

Need Help with Java-SWING progrmming - Swing AWT
Need Help with Java-SWING progrmming  Hi sir, I am a beginner... with a program in swing. Could you help me with an example? Regards Sreejith ...://www.roseindia.net/java/example/java/swing/Print.shtml Thanks 

Java3D Questions

SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING 

Swing AWT

swing
swing  Write a java swing program to delete a selected record from a table 

Swing AWT

Swing - Swing AWT
initialize the String variable Str therefore you got that error. For more information, visit the following link: http://www.roseindia.net/java/example/java/swing/get_jtextfield_value_from_anothe.shtml Thanks 

Swing AWT

java compilation error - Swing AWT
java compilation error   NestedPopupMenu n = new NestedPopupMenu(); getting error as "local variable n is never read  Hi dharani, This is running code. I hope that this code will help you. import java.util. 

Swing AWT

java swing - Swing AWT
: http://www.roseindia.net/java/example/java/swing/ Thanks...java swing  how to add image in JPanel in Swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image. 

Swing AWT

java swing - Swing AWT
java swing   Iam developing a java web browser.Actually my code works fine ie. i can load a web page without proxy.But in my place i have only proxy... a proxy or how to make my java web browser to listen to proxy setting??? please help 

Swing AWT

Java logical error - Swing AWT
Java logical error  Subject:Buttons not displaying over image Dear Sir/Madam, I am making a login page using java 1.6 Swings. I have want to apply... on it. But the buttons are not displaying properly. So,I request your kind help. I have 

Swing AWT

Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed 

Swing AWT

Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed 

Java Beginners

java swing.
java swing.  Hi How SetBounds is used in java programs.The values in the setBounds refer to what? ie for example setBounds(30,30,30,30) and in that the four 30's refer to what 

Applet Questions

Swing - Applet
information on swing visit to : http://www.roseindia.net/java/example/java...Swing  Hello, I am creating a swing gui applet, which is trying to output all the numbers between a given number and add them up. For example 

Swing AWT

scrolling a drawing..... - Swing AWT
you suggest something or the error which I might be making ?  Hi friend, I am sending you a link. This link will help you. Please visit for more information. http://www.roseindia.net/java/example/java/swing/use-canvas 

Swing AWT

java swings - Swing AWT
. http://www.roseindia.net/java/example/java/swing/draw-simple-bar...java swings  I am doing a project for my company. I need a to show... write the code for bar charts using java swings.  Hi friend, I am 

Java Beginners

how to create menubar and the below background color/image in java swing
how to create menubar and the below background color/image in java swing  how to create menubar and the below background color/image in java swing 

Swing AWT

Swing paint - Swing AWT
the Swing Applet, use html file with the following code: Java Applet Demo...Swing paint  hi, i want to print something on window using swing... on window... while compiling error is coming in super... so pls let me knw whats 

Java Beginners

Swing Button Example
Swing Button Example  Hi, How to create an example of Swing button in Java? Thanks   Hi, Check the example at How to Create Button on Frame?. Thanks 

Swing AWT

java-swings - Swing AWT
://www.roseindia.net/java/example/java/swing/ Thanks. Amardeep...java-swings  How to move JLabel using Mouse? Here the problem is i... at runtime by moving labels using mouse. Plz tell me the correct way to solve 

Java Beginners

swing - Java Beginners
swing  i tried many programs in swing to set a background image but everytime it shows somerun time error...plz anyone help me by sending a program for setting background image using swing....  Hi Friend, Try 

Swing AWT

java - Swing AWT
java  hello sir.. i want to start the project of chat server in java please help me out how to start it?? urgently....  Hi friend, To solve problem to visit this link....... http://www.roseindia.net 

Java Beginners

java swing (jtable)
java swing (jtable)  hii..how to get values of a particular record in jtable from ms access database using java swing in netbeans..?? please help..its urgent..   Here is an example that retrieves the particular record 

General

Java Swing Tutorials
with the help of Java 2D API.   Data Transfer Swing... how to create the JTabbedPane container in Java Swing. The example... components with the help of grid in Java Swing. The grid layout provides 

Java Beginners

Java swing
Java swing  how to create the login form?   1)LoginDemo.java: import javax.swing.*; import java.sql.*; import java.awt.*; import...(null,"Incorrect login or password","Error",JOptionPane.ERROR_MESSAGE 

Programming Tutorials

Java Swing Open Browser
Java Swing Open Browser Java provides different methods to develop useful applications. In this section, you will learn how to create an example that will open the specified url on the browser using java swing. This example will really 

Java Beginners

java swing and CSS
java swing and CSS  can css be used in java swing desktop application in different forms for better styles?plzz help 

Java-Tutorials

What is Java Swing?
What is Java Swing?       Here, you will know about the Java swing. The Java Swing provides... and GUIs components. All Java Swing classes imports form the import 

Swing AWT

java - Swing AWT
java  hello..sir.....plzzzzzzz help me to display selected image on JPanel.  Hi Friend, Try the following code: import java.awt.... ie) { System.out.println("Error:"+ie.getMessage()); } } public 

Java Beginners

Java swing code - Java Beginners
://www.roseindia.net/java/example/java/swing I hope this would be helpful to you...Java swing code  How to set a font for a particular cell in JTable?  Hi Friend, Please visit the following link for any kind of help 

Swing AWT

Java - Swing AWT
Java    Hi friend,read for more information,http://www.roseindia.net/java/example/java/swing 

Swing AWT

Java Compiler error - Swing AWT
Java Compiler error  Hi, I try to add quartz Lib in my HelloQuartz application. When I run HelloSchedule, I get this error: "Exception in thread... can add Jar File in Java Build Path Library. i get this message : " No entries 

Java-Tutorials

Java Swing : JLabel Example
In this tutorial, you will learn how to create a label in java swing 

Swing AWT

java swing - Swing AWT
java swing  how i can insert multiple cive me exampleolumn and row in one JList in swing?plz g  Hi Friend, Please clarify your question. Thanks 

Framework Questions

java swing
java swing  view the book details using swing 

Java Interview Questions

Java swing
Java swing  Does Swing contains any heavy weight component 

Java Interview Questions

Java swing
Java swing  what are the root classes of all classes in swing 

Java Beginners

Swing - Java Beginners
: http://www.roseindia.net/java/example/java/swing/ http://www.roseindia.net/java/example/java/awt/ Hope that it will be helpful for you. Thanks... links: http://www.grandt.com/sbe/ http://www.javafaq.nu/java/free-swing-book 

Java Beginners

can interface solve this problem in java
/tutorial/java/swing/datePicker.html   thanks very much...can interface solve this problem in java  I have a JDialog which... this calander class. can interface solve this problem. If yes then how. pls 

Swing AWT

Use of Hyperlink in Swing - Swing AWT
is: Is it possible to use Hypelink in java Swing. Please Help. Regards... the Java Swing and I have to create Hyperlink in the JTable cell so that if the user.... I hope that, this code will help you. new HyperlinkListener() { public 

Java Beginners

java swing
java swing  what is java swing   Swing is a principal GUI toolkit for the Java programming language. It is a part of the JFC (Java Foundation Classes), which is an API for providing a graphical user interface for Java 

Swing AWT

java - Swing AWT
Java Implementing Swing with Servlet  How can i implement the swing with servlet in Java? Can anyone give an Example??   Implementing Swing with Servlet Example and source Code Servlet SwingToServlet 

Java Beginners

Opening IE from Java Swing Application in Kiosk mode
Opening IE from Java Swing Application in Kiosk mode  Hi All, I want to open a URL in IE from my Java Swing application running in Wiindows. I am...(true); } }   Here is a simple example of opening browser in swing 

Java Beginners

java swing
java swing  how to connect database with in grid view in java swing   Hi Friend, Please visit the following link: Grid view in java swing Thanks 

Swing AWT

Java swing
Java swing  Write a java swing program to calculate the age from given date of birth 

Java Beginners

java swing
java swing  add two integer variables and display the sum of them using java swing 

Swing AWT

java swing - Swing AWT
java swing   how i can insert in JFrame in swing?  Hi Friend, Try the following code: import java.awt.*; import javax.swing.*; import java.awt.event.*; class FormDemo extends JFrame { JButton ADD; JPanel 

Swing AWT

Swing program
Swing program  Write a java swing program to get name and email id. Display the error message if email id is not in xxxxx@xxxx.xxx format.   import java.awt.*; import java.sql.*; import javax.swing.*; import 

Swing AWT

Java - Swing AWT
Java  program to read,add,update,delete the database using swing and servlet  Hello Just Refer Don't Copy the content of this URL http://java2s.com/ Thanks Rajanikant  Hi friend, To solve 

Swing AWT

query - Swing AWT
java swing awt thread query  Hi, I am just looking for a simple example of Java Swing 

Swing AWT

Executing JAR file - Swing AWT
:\>java -jar secl.jar then, the following error msg is shown... error msg dialog box is shown: Could not find the main class.Program will exit! How can I solve this problem? Please help me 

Blog

Sitemap Java Swing Tutorial
-to-One Relationship | JPA-QL Queries Java Swing Tutorial Section Java Swing Introduction | Java 2D API | Data Transfer in Java Swing | Internationalization in Java Swing | Localization | What is java swing 

Swing AWT

Swing Program
Swing Program  write a java swing program to get username and password. The name contains only characters while password is masked... { JOptionPane.showMessageDialog(null,"Error!"); text1.setText 

Java Beginners

need to solve the below question - Java Beginners
need to solve the below question  I need to write an application that uses the circle class.it must read a radius of a circle from the user .create a circle object and return the object 

Swing AWT

Date picker in Java Swing
in need of Time Picker just like the Date picker available in java Swing. Kindly... link: Java Date Time Picker Example   Hello Sir, Thank... thoroughly . But Sir, I want Time Picker In java swing desktop application 

Java Beginners

How to Hide Button using Java Swing
or provide online example reference. Regards,   hi, In java Programming application how to hide the buttons using Java Swing. Please Visit this below reference link http://www.roseindia.net/tutorial/java/swing 

Java Beginners

jdbc &swing - Java Beginners
jdbc &swing  I've used a progress bar in a database file upload window using swing.. But I can't set the uploading processing time with the progress bar.. please help me as early as possible.. How can I use progress bar against 

Java Beginners

java swing in netbeans
java swing in netbeans  how can create sub menu in java swing using...[]) { JFrame frame = new JFrame("MenuSample Example... backwardMenuItem = new JMenuItem("Java"); newmenu.add(backwardMenuItem 

Java Beginners

java swing - Java Beginners
(){ JFrame f = new JFrame("Frame in Java Swing"); f.getContentPane().setLayout(null...java swing  How to set the rang validation on textfield, compare... want to send the selected item in database , how to send , plz help 

Java Beginners

java swing - Java Beginners
java swing  utlility of super.paintComponent(Graphics g) in java? what does it do actually i.e. which class it is extending or method overriding? Please clarify this with example 

Java Code Examples

Java Swing: Validate radiobutton
Java Swing: Validate radiobutton In this tutorial, you will learn how to validate radiobuttons in Java Swing. Radio buttons are the group of buttons where only one button can be selected at a time. Swing supports radio buttons 

Java Beginners

Java swing - Java Beginners
Java swing  Hi, I want to copy the file from one directory... will be displayed in the page and progress bar also. Example, I have 10 files...; public Copy() { JFrame frame = new JFrame("Swing Progress Bar 

Swing AWT

Java Dialogs - Swing AWT
visit the following links: http://www.roseindia.net/java/example/java/swing/GrideComponents.shtml http://www.roseindia.net/tutorial/java/swing/springlayout.html http://www.roseindia.net/java/example/java/awt/borderlayout-example 

Java Beginners

Java swing
to the database using java swing...Java swing  I create one table. That table contains task ID and Task Name. When I click the task ID one more table will be open and that table 

Java Beginners

Java swing
are displayed in the table..I need the source code in java swing...Java swing  If i am login to open my account the textfield,textarea and button are displayed. if i am entering the time of the textfield 

Swing AWT

tree - Swing AWT
visit the following code: http://www.roseindia.net/java/example/java/swing/TreeComponent.shtml http://www.roseindia.net/java/example/java/swing/AddNodes.shtml http://www.roseindia.net/java/example/java/swing/RemoveNodes.shtml Thanks 

Java Beginners

Java Swing code for zoom in and out
Java Swing code for zoom in and out  hi.......... I require a code in java swing for image zoom in and zoom out can u tell me how it can be done or what is the code plz help 

Java Beginners

to solve the error - Java Beginners
to solve the error  class bubbleSort1{ public static void..., Your code having error : You not have declare any main method So java.lang.NoSuchMethodError: main error occur and you add this main method 

Java Beginners

jTextField in swing
jTextField in swing  I am new to java and i am making a registration form.i just want to know if there is any code in which a string cannot... not respond to any character in jtextfield.plzz help 

Swing AWT

Java - Swing AWT
. http://www.roseindia.net/java/example/java/swing... or paint from my swing program?  Hi friend, import java.awt....("Paint example frame") ; getContentPane().add(new JPaintPanel 

Java-Tutorials

JSlider Component of Java Swing
JSlider Component of Java Swing     ... component of Java Swing. A Slider is a Swing tool which you can use for selecting... below: Before touch the JSlider Component: After drag the JSlider Component 

Swing AWT

Authentication of password - Swing AWT
information. http://www.roseindia.net/java/example/java/swing/ Thanks...?????  check out the below link  check out this link http 

Swing AWT

java swing - Swing AWT
java swing  how to save data in sql 2005 while insert in textfield  Hi Friend, Try the following code: import java.sql.*; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import 

Swing AWT

java - Swing AWT
java  how can i add items to combobox at runtime from jdbc   Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/AddRemoveItemFromCombo.shtml Thanks  Hi Friend 

Java Beginners

Java swing - Java Beginners
Java swing  Hi, I want to copy the file from one directory to another directory,the same time i want to get the particular copying filename will be displayed in the page and progress bar also. Example, I have 10 files 

Java-Tutorials

Swing In Java
. This example will demonstrate you about how to use the Swing components in Java...Swing In Java In this tutorial we will read about the various aspects of Swing... example etc. What Is Swing ? Swing is a part of JFC also known as Oracle's 

Java Beginners

Java swing code
Java swing code  can any one send me the java swing code for the following: "A confirmation message after the successful registration of login form...(null,"Error!"); text1.setText(""); text2.setText 

Java Beginners

Swing programming - Java Beginners
{ JFrame f = new JFrame("Frame in Java Swing"); f.getContentPane... in Java Swing"); f.getContentPane().setLayout(null); JLabel lbl1 = new JLabel...Swing programming  import javax.swing.*; import java.awt.*; public 

Swing AWT

Need Help To Connect XML as backend in Java-Swing
Need Help To Connect XML as backend in Java-Swing  Seat arrangment swing screenshot I made XML program to connect to swing like this. <?xml version="1.0" encoding="iso-8859-1"?> <BUISNESS-CLASS> <PERSON> 

Swing AWT

java - Swing AWT
What is Java Swing AWT  What is Java Swing AWT 

Java Beginners

java swing - Java Beginners
java swing  How to upload the image in using java swings. ex- we make a button to browsbutton and savebutton , when we click on the browsbutton , i can brows the image from the computer. plz help soon......... thanx.  

Java Beginners

java swing jdbc - Java Beginners
java swing jdbc  hello, i want to populate the data(ms access) to the jtable component and want to perform some operations on it like add,edit,delete. Again i want to store the updated data to the database. can you help me out 

Java Beginners

Validation in swing - Java Beginners
Validation in swing  I want to validate my swing program. If I didnt enter the field in text box a msgbox should have to appear that enter all... the field","Error",JOptionPane.ERROR_MESSAGE); } else 

Java Beginners

swing - Java Beginners
Swing application testing  What are the conventions for testing a Java swing application 

Java Beginners

Java swing
Java swing  how to create simple addition program using java swing?   import java.awt.*; import javax.swing.*; import java.awt.event.*; class SumOfNumbers extends JFrame { SumOfNumbers(){ JLabel lab1=new 

Swing AWT

AWT-swings tutorial - Swing AWT
. This link will help you. Please visit for more information. http://www.roseindia.net/java/example/java/swing/ http://www.roseindia.net/java/example/java 

Swing AWT

Swing Program
Swing Program  Write a java swing program to calculate the age from given date of birth 

Swing AWT

code - Swing AWT
code  i want example problem for menubar in swings  Hi Friend, Please visit the following links: http://www.roseindia.net/java/example/java/swing/SwingMenu.shtml http://www.roseindia.net/java/example/java/swing 

Swing AWT

Java - Swing AWT
Java  Hello friends, I am developing an desktop application in java & I want to change the default java's symbol on the top & put my own symbol there.. Can Anyone help me 

Java Beginners

Java swing
Java swing  when i enter the time into the textbox and activities into the textarea the datas saved into the database.the java swing code for the above item   import java.sql.*; import java.awt.*; import javax.swing. 

Swing AWT

java - Swing AWT
java  how to use JTray in java give the answer with demonstration or example please 

Swing AWT

Image Selection - Swing AWT
. Can you help me??? Thanks, SandeepGoel...  Hi friend... { System.err.println("Error saving...) { System.err.println("Error reading file 

Java-Tutorials

Java Swing : JFrame Example
Java Swing : JFrame Example In this section, you will learn how to create a frame in java swing. JFrame : JFrame class is defined in javax.swing.JFrame....(), getGlassPane(), getJMenuBar() etc.. Example : import java.awt.Dimension; import 

Ajax Questions

ajax code please help to solve this........
ajax code please help to solve this.  in this i am trying to get data... null; } please help me when i am running this it show an error... and use ajax onchange but when i am trying to do so it show some error 

General

Causing Deadlocks in Swing Code
Causing Deadlocks in Swing At First Consider the Deadlocks A deadlock... given below the frame is being constructed by the static block and by adding  the new DesktopPain to the Content Pain it starts the Swing Thread 

Swing AWT

Design a Toll bar - Swing AWT
a link. This link will help you. Please visit for more information. http://www.roseindia.net/java/example/java/swing/CreateToolbar.shtml Thanks 

Java Beginners

Java swing
Java swing  How to combine two java files 

Swing AWT

Java Swing Drag drop - Swing AWT
Java Swing Drag drop  Hi i have following code that can help to drag abd drop , The code is also from Roseindia,net I want to keep orignal componant on frame after drag please help me import java.awt.*; import 

Java Beginners

java swing
java swing  meaning of out.flush 

Development process Questions

java swing
java swing  what is code for diplay on java swing internal frame form MYSQL DB pls send   Here is a code of creating form on jinternalframe and connect to mysql. import java.io.*; import java.sql.*; import java.awt. 

Swing AWT

Look and Feel - Swing AWT
: http://www.roseindia.net/java/example/java/swing/GettingAndSettingLAF.shtml http://www.roseindia.net/java/example/java/swing/DefaultLookAndFeel.shtml Hope...Look and Feel  i m using netbeans for creating a swing GUI 

Advertisements Advertisements
 

 

 

DMCA.com