3,927 Posted Topics

Member Avatar for LevelSix

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() …

Member Avatar for LevelSix
0
141
Member Avatar for NycNessyness

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.

Member Avatar for Ezzaral
0
119
Member Avatar for Nick Evan

Image text mostly unreadable here. 1280x1024 on Firefox 2.0.014.

Member Avatar for Ancient Dragon
0
356
Member Avatar for 9107you

[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.

Member Avatar for Ezzaral
0
160
Member Avatar for hezfast2

Use a masked JFormattedTextField: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html[/url]

Member Avatar for hezfast2
0
108
Member Avatar for CCVM

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]

Member Avatar for CCVM
0
70
Member Avatar for mattcrow

For starters, this is not a valid method body[code]public void init() [/code]This is[code]public void init() { // stuff }[/code]

Member Avatar for javaAddict
0
145
Member Avatar for The Dude

If you take seriously the results of such a test on the internet, then yes - you're stupid.

Member Avatar for jephthah
0
263
Member Avatar for linux

Well, tech is an ever changing subject - seems only right that it wouldn't stay in the same place long :P

Member Avatar for linux
0
51
Member Avatar for rami2005

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]

Member Avatar for rami2005
0
153
Member Avatar for alannabrittany

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.

Member Avatar for javaAddict
0
125
Member Avatar for mattyd

[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 …

Member Avatar for ~s.o.s~
3
10K
Member Avatar for K?!

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 …

Member Avatar for K?!
0
9K
Member Avatar for geisteskrankhei

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.

Member Avatar for Ezzaral
0
181
Member Avatar for himanjim

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.

Member Avatar for jasimp
0
114
Member Avatar for Barman007

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 …

Member Avatar for Ezzaral
0
186
Member Avatar for fj822

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.

Member Avatar for fj822
0
146
Member Avatar for Barman007

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 …

Member Avatar for Barman007
0
93
Member Avatar for jessen

According to this listing: [url]http://java.sun.com/products/java-media/jmf/2.1.1/formats.html[/url] AVI is supported.

Member Avatar for jessen
0
128
Member Avatar for ceyesuma

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 …

Member Avatar for ceyesuma
0
106
Member Avatar for NickMalone85

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]

Member Avatar for Ezzaral
0
95
Member Avatar for chickenchaser

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.

Member Avatar for Ezzaral
0
114
Member Avatar for NycNessyness

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].

Member Avatar for NycNessyness
0
387
Member Avatar for FourOmega
Member Avatar for jephthah
0
144
Member Avatar for Natethemad

[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 …

Member Avatar for naina_gill
0
310
Member Avatar for ceyesuma

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 …

Member Avatar for Ezzaral
0
126
Member Avatar for degamer106

By using different layout managers: [url]http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html[/url]

Member Avatar for jwenting
0
183
Member Avatar for dupsykool

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] …

Member Avatar for Ezzaral
0
76
Member Avatar for jk_bscomp
Member Avatar for peter_budo
0
979
Member Avatar for firastar
Member Avatar for Ezzaral
0
59
Member Avatar for mo86uk

[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 …

Member Avatar for jwenting
0
3K
Member Avatar for javauser215

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.

Member Avatar for javauser215
0
123
Member Avatar for GrimJack
Member Avatar for WalkmanXD

[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.

Member Avatar for majestic0110
0
177
Member Avatar for monster597

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]

Member Avatar for Ezzaral
0
127
Member Avatar for disraeli

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.

Member Avatar for jbennet
0
250
Member Avatar for alpe gulay

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]

Member Avatar for TheWhite
0
97
Member Avatar for Abbigail
Member Avatar for katerinaaa

[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.

Member Avatar for alpe gulay
0
5K
Member Avatar for alpe gulay

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.

Member Avatar for alpe gulay
0
151
Member Avatar for nadhi

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 …

Member Avatar for nadhi
0
94
Member Avatar for ceyesuma

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 …

Member Avatar for ceyesuma
0
175
Member Avatar for puk

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!".

Member Avatar for javaAddict
0
186
Member Avatar for WalkmanXD

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)

Member Avatar for WalkmanXD
0
106
Member Avatar for TheWhite

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.

Member Avatar for TheWhite
0
1K
Member Avatar for MxDev

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]

Member Avatar for Ezzaral
0
57
Member Avatar for MxDev

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]

Member Avatar for Ezzaral
0
36
Member Avatar for asadii
Re: JAXB

Start with a JAXB tutorial: [url]http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html[/url] This forum is not one.

Member Avatar for asadii
0
64
Member Avatar for sunnyonedipo
Member Avatar for damson
0
98
Member Avatar for briansmall

Well, it might not be as frenzied without Josh to stir it up. I guess we'll see.

Member Avatar for ZZucker
0
560

The End.