3,927 Posted Topics
Re: There is no paintComponent() method on JFrame, which is why it is not being called from repaint(). There is a paintComponents() method that paints all of the child components in the container by calling paintComponent() on each of them. Because JFrame is a top-level container, you have to override paint() … | |
Re: Try adding the MaskFormatter like so[code]try { MaskFormatter formatter = new MaskFormatter("?????"); txtMask.setFormatterFactory(new DefaultFormatterFactory(formatter)); txtMask.setFocusLostBehavior(JFormattedTextField.COMMIT); } catch(ParseException ex) { ex.printStackTrace(); }[/code]That mask only allows up to 5 letters, so you'll have to add the others up to 25. | |
Re: [QUOTE=9107you;610712] i think i have to use a stringbuffer but i don't know where to use it[/QUOTE] In the translate method - and use StringBuilder instead of StringBuffer. | |
Re: Use a masked JFormattedTextField: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html[/url] | |
Re: That is exactly what can be found in the "Read Me" post which is stickied at the top of this forum: [url]http://www.daniweb.com/forums/thread99132.html[/url] | |
Re: For starters, this is not a valid method body[code]public void init() [/code]This is[code]public void init() { // stuff }[/code] | |
Re: If you take seriously the results of such a test on the internet, then yes - you're stupid. | |
Re: Well, tech is an ever changing subject - seems only right that it wouldn't stay in the same place long :P | |
Re: Plenty of info here: [url]http://en.wikipedia.org/wiki/Shortest_path_problem[/url] and here [url]http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=shortest+path+weighted+graph[/url] | |
Re: Nope, this isn't a homework service. You need to make an effort on your own first. If you have problems, post your code and the errors or specific questions. | |
Re: [quote=christina>you;422624]Just because most people will say they are Christian, that doesn't mean they [I]really[/I] are Christian. There are some people that call themselves "Christians" and then go out to the bar, strip clubs, parties, etc. Their real title is "hypocrite." And a lot of those "Christians" don't even go to … | |
Re: You can do whatever you want when the mouse enters or leaves the button[code=java]jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jButton1.setBackground(Color.GREEN); } public void mouseExited(java.awt.event.MouseEvent evt) { jButton1.setBackground(UIManager.getColor("control")); } });[/code] or to just underline[code=java]jButton1.addMouseListener(new java.awt.event.MouseAdapter() { Font originalFont = null; public void mouseEntered(java.awt.event.MouseEvent evt) { originalFont = jButton1.getFont(); Map … | |
Re: You're on the right track generating the list of numbers 1 to N*N into an array and then shuffling them. You just need to consider how to pick a random place in the array to place each number. | |
Re: You closed your applet tag before your parameters. Basically it's malformed HTML that is causing your problem.[code] <APPLET[COLOR=red][B]>[/B][/COLOR] code="chat.class" width=650 height=600></APPLET>[/code] Side note: don't bold your entire message for no reason. | |
Re: Change your print methods to return the Strings you want, rather than actually sending output to System.out. Your GUI class can then put those strings wherever it wants to. If fact you could just override toString() to return the string representation of each of those objects and do away with … | |
Re: Interfaces can only contain method signatures and final static fields. They are not the same as a class. You need to write a class that implements the interface if you want to add other properties. | |
Re: Yes, the code in your action listener will execute in it's entirety without pause for input. If you don't want to use modal dialogs to prompt for input, then you need to separate the action listener code into section to respond to each input action (which will occur when the … | |
Re: According to this listing: [url]http://java.sun.com/products/java-media/jmf/2.1.1/formats.html[/url] AVI is supported. | |
Re: If your database supports the "TOP" clause, you can use that. If not, then this is usually done by calling setMaxRows() on the Statement object in JDBC. Since you are using beans binding, I have no idea what to tell you because I don't have any api docs for that … | |
Re: You are only reading a single word here[code]message = sc.next();[/code]Use nextLine() to read the entire input line[code]message = sc.nextLine();[/code] | |
Re: Just drop the call to set hours to be less than twelve[code]hours.setValue(hours.getValue() - 12);[/code]and leave it in 24-hour time. You can display it in 12-hour format without altering the underlying value. | |
Re: You can also use a JFormattedTextField: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html[/url] or an InputVerifier: [url]http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#inputVerification[/url]. | |
Re: Look around you a bit - you might not be where you think you are... | |
Re: [QUOTE=CoolGamer48;594307]Just curious - were you actually a game programmer somewhere? Or do you know people that have been and then left? Or do you have another source?[/QUOTE] There is plenty of info available out on the net about the working conditions associated with professional games development. Search around a bit … | |
Re: There is absolutely no way to tell the type of the collection from that line of code. The return type of that method will be documented by whatever API describes the class of "searchQuery1". The question about "search" vs "Search" doesn't make any sense - it's your variable declaration, call … | |
Re: By using different layout managers: [url]http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html[/url] | |
Re: There is a wealth of info on the Sun certifications and exams online that you could easily locate with a simple search, but there is no Certified Java Administrator (what is there to "administer" in Java?). SCJA is Sun Certified Java Associate and you can get more info here: [url]http://www.sun.com/training/certification/java/index.xml[/url] … | |
Re: Opening a new cmd window should be all that is required to pick up the change. | |
| |
Re: [QUOTE=chamsups;602188]DO yu have the code for the other classes......I have to write the whole code for all classes...So if you could can you please send me the rest of the code Thanks Chamsups PS; My email is [email]chamsups@yahoo.com[/email][/QUOTE] This is not a "gimme teh codez" forum. Do your own work … | |
Re: Read the error message closely, they are pretty clear about the issues. You are calling things that do not exist in the parent class in that first file. The second file has structural problems such as a missing brace or semi-colon. | |
Re: [QUOTE=majestic0110;601863]So my suspicion is correct? That.....[/QUOTE] No. The point was that all [I][U]objects[/U][/I] are runtime constructs. [I][U]Classes[/U][/I] are created at compile time. This has nothing to do with reflection. | |
Re: JLabel is handy for displaying such images if you are wanting them to be separate from your buttons. [url]http://java.sun.com/docs/books/tutorial/uiswing/components/label.html[/url] | |
Re: Well, most of the site is for technical discussions and problem solving. The "lounge" forums are just informal places for idle chatter. There certainly are not any "adult-only" type areas on the site, so beyond just chatting with people there isn't really much else to it. | |
Re: There are a ton of basic tutorials for this. The Swing trail from Sun is a great place to start: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html[/url] | |
Re: [code] BufferedReader br = new BufferedReader(new FileReader("c:/test.txt")); String strLine; while((strLine=br.readLine())!=null) { if (strLine.length()>0) System.out.println(strLine); } [/code] Of course, you will probably want to write those lines back out to a file instead of printing them to System.out. | |
Re: A directory is deleted just like any file - with [URL="http://java.sun.com/javase/6/docs/api/java/io/File.html#delete()"]File.delete()[/URL]. A directory must be empty to be deleted, so if it contains files you must recurse the directory and delete all files and subdirectories first. | |
Re: Your question is too broad. Which part of the desired operation do you not understand? Do you know how to save data to a database? Do you know how to retrieve values from a UI component? You need to narrow your question a bit, unless you expect someone to write … | |
Re: Read the stack trace. It's clear from this [code]Caused by: Exception [TOPLINK-8025] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EJBQLException [B]Exception Description: Syntax error parsing the query [:partial], line 1, column 1: unexpected token[/B] [:partial]. Internal Exception: line 1:1: unexpected token: :partial[/code] that you have a syntax error in … | |
Re: Parsing the answer needs to occur after they have entered the answer, such as in a button handler for the "Ok" button. You are currently parsing the original value you placed in that field "Enter Answer here!". | |
Re: You don't delete objects - they get cleaned up when they go out of scope and have no more active references. Perhaps this article will answer your questions: [url]http://www.ibm.com/developerworks/java/library/j-jtp01274.html[/url] (though next time, you don't need to put 15 questions marks on them - one will suffice) | |
Re: Your button already has a mouse listener installed before you add your own. The button starts with a BasicButtonListener by default. Your action listener is removing that listener, but leaving your own mouse listener in place. | |
Re: Use a JDialog that is modal. It's hard to be more specific since there are a few different ways in which JOptionPane and JDialog can be used. [url]http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html[/url] | |
Re: This is done by default if you specify the "parent" parameter. If you are using your own JOptionPane class you can use setLocationRelativeTo(). [url]http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html[/url] | |
Re: Start with a JAXB tutorial: [url]http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html[/url] This forum is not one. | |
Re: Definitely one of the most unique topic suggestions I have seen! :) | |
Re: Well, it might not be as frenzied without Josh to stir it up. I guess we'll see. |
The End.