Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JOptionPane won't pop up

Reply
Thread Tools

JOptionPane won't pop up

 
 
rabbithole rabbithole is offline
Junior Member
Join Date: Jun 2008
Posts: 3
 
      06-26-2008
Hi guys,

I'm trying to write a program and I want to show a JOptionPane messagebox when an error occurs.

I have this code:
Code:
        try {
            MyMethod();                                              
        } catch (FileNotFoundException ex) {
             JOptionPane.showMessageDialog(this,"File not Found");
            System.out.println("File not Found");
        }
allthough the filenotfound message is shown, the option pane is not.
the code is in a class that starts with:
Code:
public class Gui extends javax.swing.JFrame
apparently the 'this' should be something else?
can anyone give me an idea on what?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using JOptionPane jazzy Java 0 04-18-2004 05:59 AM
Using JOptionPane jazzy Java 0 04-18-2004 05:59 AM
thread safeness of JOptionPane et al Alex Hunsley Java 0 01-13-2004 11:52 AM
focus with multiple JOptionPane.showInputDialog calls Joseph M. DeAngelo Java 0 11-09-2003 07:48 AM
JOptionPane Cannot Override LookAndFeel's Font... SuperChuck Java 3 08-07-2003 03:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57