1. Eclipse Java project error: cannot resolve declaration in swing stackoverflow.comI get the following error in Eclipse: DISPOSE_ON_CLOSE cannot be resolved something.java javadir/src/ line xxxx Java Problem DISPOSE_ON_CLOSE is in javax.swing but even when I add import javax.swing.*; it doesn't work. ANy ideas? |
2. Null pointer exception error stackoverflow.comWhen I run my program I get this error nullPointerException: null.
|
3. Reading in a file from Java GUI error stackoverflow.comWith assistance from others, I have a program that allows a user to input their employee name and number and then their hourly wage and their total number of regular hours ... |
4. private javax.swing.JTextField3; error stackoverflow.comI greatly thanks those that reply to my question "main method not found error", after correcting all the parenthesis and it seem the code is alright.On the IDE its still indicate ... |
5. Java: Show crashes in GUI, but suppress warnings stackoverflow.comFor desktop apps, it's useful to see the stacktrace on the GUI when the program crashes. I implemented this in Java by replacing System.err with my own error handler, which redirects ... |
6. Problem with Inner Class. Illegal Start of Expression error stackoverflow.comI am practicing using inner classes but am having difficulty with a homework question: It is as follows: Create a Swing component class BetterButtons that extends JPanel and has three ... |
7. Cascading runtime errors in Java Swing stackoverflow.comI'm currently integrating some new classes into an existing application. I have a JDialog which, when clicked, throws a number of runtime exceptions. I'm new to Java debugging - why would all ... |
8. error in running a simple swing program stackoverflow.comi just started learning swings. And thought of trying out a simple program, but i can't run it.
|
9. Backend for Java exception reporting GUI stackoverflow.comVery frequently I see error reporting GUIs in commercial software. This includes the whole gamut of commercial software: games, enterprise apps, office apps, etc. For some of my company's software I would ... |
10. java out of memory error when executing a swing client stackoverflow.comMy executable swing client throws out of memory exception when executed from a remote machine. However, executing the client from command line (increasing the heap space) using the following command works.
|
11. Errors with Java Swing - Unknown changes stackoverflow.comI have been working on a Swing based java program for a while now, today I have been editing the JComboBox (using Netbeans so I am unable to directly edit the ... |
12. Java GUI won't returns error when attempting o stackoverflow.comRegarding the code below, I'm trying to get the BOOKGUI class to access the BOOKSHELF class and return the value from the method BOOKSHELF CLASS
|
13. Java GUI error - Type mismatch: cannot convert from String to double stackoverflow.comLine 100 |
14. Java AWT-EventQueue-0 Error stackoverflow.comcan someone help me to debug this, Edit 1: the error is not in the code below *Error occurs within the code below:*
|
15. facing following error in programme stackoverflow.com
|
16. My eclipse detects an error stackoverflow.comwhats wrong with my my, the FileFilter says its cant istantiate
|
17. how can i solve this error stackoverflow.comThis is the complete code :
|
18. Error with DocumentListener stackoverflow.comI have a JTextField that I want to be limited to fifteen characters. The problem is that when I type over 15 characters, it errors. How can i fix this? Do ... |
19. Curious error in Eclipse IDE - stackoverflow.comI am new to swing development using eclipse but I have been using eclipse for my java code development for more than a year. Today when I wrote a sample swing ... |
20. method must call super() error in Netbeans stackoverflow.comRecently I've made a Netbeans project and I am using SVN along with it. I am seeing duplicate class error, and in the console it says
|
21. Java Error to do with array searching stackoverflow.comHey guys i'm trying to use drawString() function to draw the result from a search in a array. I am using the code below
|
22. calculator error gui stackoverflow.comIm finally done with my calculator project. I really thought this ones gonna work, but i get an error each time i press the equal button. I dont know why. heres ... |
23. Strange Swing compile-time accessibility error stackoverflow.comHere is the code -
|
24. JVM Fatal Error in native code, Not sure what to do stackoverflow.comI'm developing a game in Java using LWJGL. Along with the main game, I'm developing a few Swing-based applications (a launcher, a configuration editor, and a map editor). When I run the ... |
25. Geotools Quickstart tutorial JFileDataStoreChooser.showOpenFile is causing error stackoverflow.comI was looking at the Geotools Quickstart tutorial using Eclipse http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html I followed all the steps and it all went well until I ran the Quickstart class When I run the Quickstart ... |
26. There are errors but I can't see where stackoverflow.comFor some reason I am receiving errors in the code below and I can't see why, can you spot any?
|
27. Null pointer exception error that I am having trouble figuring out? stackoverflow.comI can't figure out how to fix my null pointer. My holder (Holder Pattern class) is undefined - I'm not sure how to fix it. I am still pretty new to ... |
28. Beginner programmer: can someone help me figure out my null pointer error? stackoverflow.comI think my _holder and/or _gooseAction is null....I am just so frustrated right now with figuring out where in my code I messed up or am passing in null values. I ... |
29. java-An unexpected error has been detected by HotSpot Virtual Machine?what is the solution stackoverflow.comAn unexpected error has been detected by HotSpot Virtual Machine: EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d6cf45b, pid=1800, tid=2824 Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode, sharing) Problematic frame: V [jvm.dll+0x8f45b] An error report ... |
30. Error loading custom component in GUI builder forums.netbeans.orgNetBeans Forums - Error loading custom component in GUI builder Search: NetBeans Forums FAQ Search Memberlist Register Profile Log in ... |
31. netbeans 6.9.1 javax.swing doen not exist error forums.netbeans.orgIs there a problem about java me in netbeans 6.9.1? I'm creating a new java me project and selecting CDC Application. and than I'm adding a AGUI Xlet Form to project. I'm not doing anything else. I compiled the project and the following errors appeared Code: Compiling 2 source files toC:\Documents and Settings\atilla\My Documents\NetBeansProjects\CdcApplication6\build\compiled C:\Documents and Settings\atilla\My Documents\NetBeansProjects\CdcApplication6\src\NewAGUIXlet.java:17: package javax.swing ... |
32. GUI error display - when external system is down. coderanch.com |
33. Please help! runtime errors..... coderanch.comThought I would follow up on this for those who may have read it and not had any suggestions. I took my program to a C++ programmer friend of mine who knows Java well enough. He spent about 4 hours going through and testing all my code and then removed all traces of Visual Cafe in the boot sequence on my ... |
34. No error But result not shown coderanch.com |
35. Help! Relocation error/symbol not found coderanch.com |
36. Error Caused by Forte??(Urgent) coderanch.com |
37. No suitable driver error coderanch.comHi, I am trying to connect to a database and display the results in an applet using JTable. I am using a TableModel in which I have the following statements: try { Class.forName("oracle.jdbc.driver.OracleDriver"); DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); Connection con = DriverManager.getConnection("jdbc [img]http://www.javaranch.com/ubb/redface.gif[/img]dbc:thin:@union21:1521:UNION1B","alma","alma"); sqlStatement = con.createStatement(); ResultSet rs = sqlStatement.executeQuery("select * from holiday"); numCols = rs.getMetaData().getColumnCount(); columnNames = new String[numCols]; //Get the column ... |
38. Run time error...tricky one.. coderanch.com |
39. ERROR IN CODE coderanch.comHi Mike, You are missing the AlertDialog class! You need the class in order for your class to use it. Another error is that you are missing the init method declaration in front of the braces. It should look something like this: public void init() { Label label1 = new Label( "Input the payment per hour :" ); ... } Another ... |
40. package error!!! coderanch.com |
41. Awt vs. Swing error coderanch.comimport javax.swing.*; public class testFrame extends JFrame { static JFrame frame; static JDesktopPane desktop; public testFrame() { desktop = new JDesktopPane(); this.setContentPane(desktop); desktop.setLayout(new BorderLayout()); } public static void main(String[] args) { frame = new testFrame(); frame.setBounds(0, 0, 300, 300); frame.setVisible(true); } public void myInternalFrame() { //You should have a seperate class file that extends JInternalFrame internalFrame if = new internalFrame(); //set ... |
42. error with AFS, pls help! coderanch.com |
43. get.contentpane() error coderanch.comHi Guys, I am using a class created by a collegue called Picture, unfortunately he is no longer around. the class looks as follows: public class Picture { static JFrame myFrame; private ImageIcon myPic; private JLabel myLabel; private JSplitPane mySplit; public Picture() { myPic = new ImageIcon("soap1.jpg"); myLabel = new JLabel(myPic); myLabel.setPreferredSize(new Dimension (myPic.getIconWidth(), myPic.getIconHeight())); JScrollPane picScroll = new JScrollPane (myLabel); ... |
44. JREW error while closing appln-urgent coderanch.comHello ,In my application user receives a JREW error in destination LAN product,usually when a user attempts to login from the login screen after another user has exited an interface back to login screen. Error message says: "Program Error: jrew.exe has generated an illegal operation and will be closed by windows.You will need to restart the program. An error log is ... |
45. Error on JTabbePane coderanch.comi have this simple GUI design program which when i run it produces this following error: java.lang.ArrayIndexOutOfBoundsException at javax.swing.plaf.basic.BasicTabbedPaneUI.paintTabArea(BasicTabbedPane UI.java:544) at javax.swing.plaf.basic.BasicTabbedPaneUI.paint(BasicTabbedPaneUI.java :497) at javax.swing.plaf.metal.MetalTabbedPaneUI.paint(MetalTabbedPaneUI.java :666) at javax.swing.plaf.metal.MetalTabbedPaneUI.update(MetalTabbedPaneUI.jav a:561) at javax.swing.JComponent.paintComponent(JComponent.java:537) at javax.swing.JComponent.paint(JComponent.java:804) at javax.swing.JComponent.paintChildren(JComponent.java:643) at javax.swing.JComponent.paint(JComponent.java:813) at javax.swing.JComponent.paintChildren(JComponent.java:643) at javax.swing.JComponent.paint(JComponent.java:813) at javax.swing.JComponent.paintChildren(JComponent.java:643) at javax.swing.JComponent.paint(JComponent.java:813) at javax.swing.JComponent.paintChildren(JComponent.java:643) at javax.swing.JComponent.paint(JComponent.java:813) at javax.swing.JLayeredPane.paint(JLayeredPane.java:552) at javax.swing.JComponent.paintChildren(JComponent.java:643) at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4742) at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688) at javax.swing.JComponent.paint(JComponent.java:794) at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21) ... |
46. Memory Errors and Swing/AWT coderanch.comHow can I make sure that my unused Components are being destroyed by the garbage collector? I keep getting an out of memory error after I make a few panels containing a large image. Each time, I overwrite the old panel with the new image. However, I suspect that the old panels are not being garbage collected due to some sort ... |
47. help with error coderanch.comSo what I am assuming is this is probably an Editor problem more than a JAVA problem since you are not compiling at the command line. 1. See if you can compile it at the command line 2. In Jcreator, go to Configure --> Options 3. Click on JDK Profiles 4. See if there is one. If it is red, then ... |
48. error when i run the code coderanch.com |
49. Error !! coderanch.comHi John, I understand that you are using both "java.awt.List" and "java.util.List" in the same class, correct? If that is the case, then in your code, the java compiler doesn't know which "List" you are referring to if you just write "List". That's why the error message says "ambiguous". You _must_ fully qualify any reference to "List" in your class. In ... |
50. What is my conceptual error? coderanch.comI am setting up a simple Swing application that has the following steps: 1. Start up with menu and empty content pane, 2. User clicks on menu item that displays FileChooser and user selects a file, and 3. Application displays a JTable that contains the data in the file on a pannel (using a Layout Manager) on the content pane. To ... |
51. Error about quicktime 6 for java? coderanch.com |
52. run time error coderanch.com |
53. need help! (one error) coderanch.comHi, I'm new with Java, and I need help with a program that I wrote. It needs to prompt the user for the x value, the y value, and the radius value, and then display the info in a JTextArea. Is giving me the following error: x = Integer.parseInt( xinput ); ^ I don't know what I'm doing wrong. I would ... |
54. Error #704 coderanch.com |
55. strange error coderanch.comhi, i have written a swing application, which runs perfectly in college on XP and win2000 but when i try to run it at home, also on a win2000 os, it throws this error. In the application if i use the default size then the application appears(at least the title bar does) but if i use "setSize(300,200);" or try to maximize ... |
56. compile error coderanch.com// program that creates a scene using shapes import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.awt.geom.*; public class Paisaje extends JFrame { public Paisaje() { super("What a scene"); setSize (400,250); // setVisible(true); } public void paint (Graphics g) { super.paint (g); // calls superclass paint method Graphics2D g2d = (Graphics2D) g; g.setcolor (Color.green); g.drawLine(5,30,350,30); g.setcolor( Color.cyan); g.drawRect(65,100,110,110); g.fillRect(255,100,10,100); g.setColor(Color.magenta); g.drawRect(65,100,110,110); g.setColor(Color.green); ... |
57. GUI runtime error coderanch.comMy program compiles fine but gives me a runtime error. 1. Can anyone explain to me what the error means? 2. Kindly help me fix it. I do appreciate this. here is the code Thanks. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class NameGui { public static void main(String[] args) { FullNameGui f = new FullNameGui(); f.setVisible(true); } } // end ... |
58. why m i getting error on deleting nodes on a fixed index????? coderanch.com |
59. detecting the error coderanch.com |
60. Error in JavaExamples book ?? coderanch.comHi all. I am trying some examples from JavaExamples book. there is an example that creates a simple web browser, some of the code : private boolean visit(URL url) { try { String href = url.toString(); this.startAnimation("Loading " + href + "..."); editorPane.setPage(url); urlField.setText(href); return true; } catch (IOException e) { this.stopAnimation(); msgLine.setText("Can't load page: " + e.toString()); return false; } ... |
61. Ant "Access is denied" error on XP coderanch.com |
62. Interesting exception errors coderanch.comI hope the changes you did would have given compilation errors itself.. Make the following changes and try it out.. public class MortgageFrame5 extends JFrame implements ItemListener, ActionListener, Runnable{ .... String[] interestArray = new String[1]; JComboBox interest = null; .... //constructor public MortgageFrame5(){ .... // retrieving the interest rates from the file try{ File interestRate = new File("interestRate.txt"); FileInputStream fileStream = ... |
63. illegal start of type error coderanch.comYour try catch block is out in the open in your class. This doesn't work. You should put it in your constructor or in a method which is called in your constructor. It is okay to have member variable declarations and/or member variable declaration/instantiations out in the open in a class but almost everything else must be in a method body ... |
64. Enumerator Error coderanch.com |
65. Best practice for error handling in Swing coderanch.comNot really. Swing is a pretty open environment compared to a J2EE container. What I've found that works for me is to make the top-level container, usually a JFrame, a listener for a custom ExceptionEvent. When he receives one of these events the frame displays a dialog with an error message and a stack trace. The controller, which initially creates the ... |
66. stack over flow error.... coderanch.comYour main method creates an instance of MainApplication which creates an instance of PanelA. PanelA's constructor creates an instance of PanelB. PanelB's constructor creates an instance of PanelA. PanelA's constructor creates an instance of PanelB. PanelB's constructor creates an instance of PanelA. PanelA's constructor creates an instance of PanelB. PanelB's constructor creates an instance of PanelA. PanelA's constructor creates an instance ... |
67. Java lang NullPointerException error coderanch.comBelow is the function that i m using on two scnerio. 1st Scnerio. ============= Just click on add button make entry into required fields and click Save Button. I call this function before saving data into database. If i am calling this function within the form (Class A) then it is working fine and good. 2nd Scnerio =========== I have 3 ... |
68. getLocationOnScreen() error with removed component coderanch.comHi, I have the following: public void paint(Graphics g){ super.paint(g); if (myActiveBean == null) { System.out.println("myActiveBean is null"); return; } Point pt = this.getLocationOnScreen(); Point pt1 = myActiveBean.getLocationOnScreen(); int x = pt1.x - pt.x - 2; int y = pt1.y - pt.y - 2; int w = myActiveBean.getWidth() +2; int h = myActiveBean.getHeight() +2; g.setColor(Color.black); g.drawRect(x,y,w,h); } it is from a ... |
69. Displaying errors in a GUI coderanch.comStatus bars aren't really designed for error messages. If you can't use dialogs then I would either use in line error messages using a simple JLabel. You can set the font so that it is red, etc. If you don't have room per say for in line error messages, then create a message header on your form of some sort that ... |
70. Saving Error coderanch.com |
71. Error Help coderanch.comHi everyone, I am doing a custom document in which i am always getting an error at the point when i want to use the java HTMLReader class. The compiler says something about an enclosing instance and i really have no idea what the compiler means. Here is the code import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.awt.print.*; import ... |
72. Selected Collating Sequence Error coderanch.com |
73. getting error while running servlet in tomcat coderanch.com |
74. controlling size of part of split pane and another error coderanch.comTry this implementation of SimpleWhiteboard. Seems to work okay now. import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import javax.swing.*; public class SW extends JPanel { private Point oldPoint, newPoint; private BufferedImage buffer; protected Image iconImage; private boolean start = true; // set up GUI and register mouse event handler public SW() { // super( "A simple whiteboard program" ); setBackground( Color.WHITE ); ... |
75. NoClassDefFound error coderanch.comI am using the newest version of TextPad, windows xp pro, etc. When I try to run this app from TextPad or the command lline I get a: Exception in thread main java.lang.NoClassDefFound InvoiceApp error on the TextPad and command line console. I am using a book and teaching myself java--I'm stuck here. My code is below. Thanks in advance for ... |
76. Array error suggestion needed coderanch.comThe soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - ... |
77. Errors when compiling this code coderanch.comI am only a learner coder. I am having trouble with this code here. I am hoping someone can give me a few hinters with what i need to do. I keep getting the error import java.lang.Object.*; > import java.awt.*; > import javax.swing.*; > > public class JDisplay > { > private Maximum in; > private JWindow win; > private int ... |
78. Stack Overflow Error - URGENT coderanch.comHi, I am not sure why this is happening in your application but in genral this happens in swing when there is a dead lock. Since swing is event driven, if for some reason there is an event that triggers another and that inturn triggers the first one, then you end up with Stack overflow exception. Hope this helps. |
79. Error package does not exist coderanch.comJDialog has a Frame argument in the constructor because usually a dialog is launched from another 'application' frame. There are also other constructors, some that take Dialogs, some that take no parameters. org.jdesktop.layout is a package that contains classes the GUI designer in Netbeans uses to layout components in your GUI - to have the produced GUI run on the command ... |
80. java command error coderanch.comYou're compiling with the javac from JDK 6, but running with an older version of Java. This often happens because Java installers will sometimes, but not always, put a copy of java.exe into c:\WINDOWS\ (or some equivalent) to support the Java Plugin. Either find that extra java.exe and replace it, or replace it with java.exe from JDK 6, or change your ... |
81. Standard bean proxy error coderanch.comHI I am creating a GUI app using eclipse.Though the application works fine, I get the following error every time I same the file in Eclipse. Version is 3.2.2 eclipse. "Error trying to set new file into editor. Reason: IWAV0006E No standard bean proxy factory has been set" Can someone let me know what this means. thanks in advance! Raghu. |
82. addMouseMotionListener error coderanch.comFirst off, my apologies on the name thing. I still haven't been able to find the problem. I'm posting the class below this. I don't know how much this explanation will help, but maybe the more info I give you guys, the more you can help: I'm making a platform game that uses a string array to store the level. Each ... |
83. Please can someone tell me why I am getting this error? coderanch.com |
84. Error in one of my classes coderanch.comhehe thanks for the reply, I worked out that I had forgotten to import awt maybe 2 mins before checking this thread. However I have another problem now... import java.awt.*; import javax.swing.*; import java.awt.event.*; public class GUIJPanel extends JPanel implements KeyListener, ActionListener { private Timer t; private int timer; private Rectangle paddle; private Rectangles blocks; private bouncyBall ball; private boolean titleScreen; ... |
85. Error in Loading Native Browser using JDIC coderanch.com |
86. Getting error when running swing program coderanch.com |
87. GUI errors coderanch.com |
88. Error !! in Swing coderanch.comimport javax.swing.*; import java.awt.event.*; public class SimpleGUI implements ActionListener { JFrame f; JButton b; public static void main(String args[]) { SimpleGUI gui = new SimpleGUI(); gui.go(); } } public void go() { f = new JFrame(); b = new JButton("Click me"); b.addActionListener(this); f.getContentPane().add(b); f.setSize(300,300); f.setVisible(true); public void actionPerformed(ActionEvent e) { b.setText("I've been clicked!"); } } |
89. Error runnning program using javx.swing in jcreator coderanch.comMitchell, JCreator installs its own JDK. It may be different from the one you installed. If you go to the configure menu and select options and then Profiles you can see what JDK it is using. You can also change the profile (or add a new one) to point to the newer version of the JDK you have installed. HTH! |
90. Swing File Error: error "NoSuchMethordError". coderanch.com |
91. Error: Cannot Find Symbol coderanch.comHi all, I am trying to make a program that has a rectangle move across the screen in a GUI window from left to right. I am getting the "Cannot Find Symbol" error on lines 27 and 32 with my personal makeEm() method, and with paintComponent(); Can someone understand why I get this error and what I might need to do ... |
92. error whitl switching from one screen to another in same application coderanch.com |
93. Getting Error coderanch.comI am preparing a application in swing. I have to display image in Jpanel but i am facing some problem My code as follows /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jpanel; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; /** * ... |
94. Error in "Headfirst Java" coderanch.comimport javax.swing.*; import java.awt.event.*; public class SimpleGui1B implements ActionListener { public JButton buton;//declare JButton as field so that you'll be able to access it inside all methods public static void main(String[] args) { SimpleGui1B gui=new SimpleGui1B(); gui.go(); } public void go() { JFrame frame=new JFrame(); buton=new JButton("click"); buton.addActionListener(this); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(buton); frame.setSize(400, 300); frame.setVisible(true); } public void actionPerformed(ActionEvent event) { buton.setText("I've been ... |
95. Errors in GUI program coderanch.comI have a program for class that has 6 parts to it. I got all of them working except the GUI part. I keep getting two errors that repeat in the code. Could someone please explain what these errors mean and how can I fix them? Here is my code: //Inventory Program Part6 //Candie Duggan //March 30, 2009 import java.text.*; import ... |
96. Error message whilst trying to load application coderanch.comHi, I am trying to build a basic light Spreadsheet application, as the subject insists I sometimes face this error message: Exception in thread "main" java.lang.NoSuchMethodError: CellLabel. |
97. GUI problem for a really beginner...error?! coderanch.comimport javax.swing.*; import java.awt.Color; import java.awt.BorderLayout; public class LayoutManager1 extends JFrame{ public LayoutManager1() { super(); setSize(400,100); getContentPane().setLayout(new BorderLayout()); JLabel label1 = new JLabel ("My Name is:"); getContentPane().add(label1, BorderLayout.NORTH); JLabel label2 = new JLabel ("Nadine"); getContentPane().add(label2, BorderLayout.SOUTH); setTitle("second window"); getContentPane().setBackground(Color.BLUE); //WindowDestroyer myListener = new WindowDestroyer(); //addWindowListener(myListener); /* * You need the next line to make it close */ this.setDefaultCloseOperation(EXIT_ON_CLOSE); /* * That ... |
98. Completely lost. Swing app consuming webservice got Timeout error (504) coderanch.comHi all. anybody could help me? I've googled a lot, found some samples, but no one successfullJ. I have a webservice running on JBOss 4.2 on a machine connected to a internal company's network (network type 10.xx). The proxy server is an ISA Server from MS. I have an swing application that needs to access that webservice. I follow a tutorial ... |
99. error while choosing filefilter ! coderanch.compublic void actionPerformed(ActionEvent e) { int result; JFileChooser chooser; chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File(".")); // chooser.setFileSelectionMode(JFileChooser.); chooser.setFileFilter(new FileFilter(){ // GETTING COMPILE TIME EXCEPTION HERE public boolean accept(File f) { return f.getName().toLowerCase().endsWith(".zip") || f.isDirectory(); } public String getDescription() { return "ZIP Files"; } }); // // disable the "All files" option. // chooser.setAcceptAllFileFilterUsed(false); // if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { System.out.println("getCurrentDirectory(): " ... |
100. Error handling in a GUI coderanch.comHi, I need a nice way to handle errors in a Swing GUI. Imagine a two-layered application (gui and database). A user clicks a button in the GUI, after which the database performs some action. Let's say a DatabaseException is thrown in the database code. Because I want to show a user friendly exception, I would assume something like this (in ... |