Posts
 
Reputation
Joined
Last Seen
Ranked #285
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
96% Quality Score
Upvotes Received
134
Posts with Upvotes
115
Upvoting Members
62
Downvotes Received
4
Posts with Downvotes
4
Downvoting Members
4
16 Commented Posts
~328.31K People Reached
About Me

Author of: JPassword Recovery Tool and a poster at: http://stackoverflow.com/users/1133011/david-kroukamp

PC Specs
Intel Core i3,2GB DDR3,320GB HDD,Intel HD Graphics 3000,Windows 7 x64
Favorite Tags

398 Posted Topics

Member Avatar for DavidKroukamp

I have seen many people struggling with Reading files and writing files in java, also a great problem is how to edit a file too. So in this code snippet I have put all these problems into one small program in hopes to help others. So this code snippet will …

Member Avatar for Bdill7
5
23K
Member Avatar for abhishek_s_n

[QUOTE=abhishek_s_n;1730322]heyy guys.. m implementing PEER TO PEER FILE TRANSFER.. What protocol should I use? TCP or UDP? And why?[/QUOTE] JamesCherrill answered that and here's an example of a TCP:[url]http://systembash.com/content/a-simple-java-tcp-server-and-tcp-client/[/url] and UDP:[url]http://systembash.com/content/a-simple-java-udp-server-and-udp-client/[/url] so you can see it for yourself

Member Avatar for Sofiia
0
1K
Member Avatar for WDrago

The error basically says it all, you cant have a non static class and reference a static variable and the same goes you cant have a non static class and then try and get reference to a static variable. to fix your problem cahnge the 'public class Counter.....' to: [code]public …

Member Avatar for JamesCherrill
0
28K
Member Avatar for jmace

[QUOTE=jmace;1742092]Well, I've been learning Java and I managed to create an FTP client that uploads and downloads files from a server. Oddly, the thing I can't figure out is how to do an FTP delete. Can anyone help me on that? I don't want to use an API or someone …

Member Avatar for rproffitt
0
704
Member Avatar for letters1417

[QUOTE=letters1417;1747761]Hello! I have to print patterns using '*' and I am at a lose how to get these patterns printed! I figured out the first one, * ** *** **** ***** ****** ******* ******** ********* ********** and now i have to do it upside down: ********** ********* ******** ******* ****** …

Member Avatar for JamesCherrill
0
2K
Member Avatar for vegaseat

@vegaseat Mythbusters proved the 7 times dry paper folding thing as busted! OIS (Out of Interests Sake) If you could theoretically fold a 1mm thick piece of paper 100 times it would be thicker than that observable diameter of the universe!!!! See here for more info: http://therealsasha.wordpress.com/2011/08/

Member Avatar for vegaseat
11
9K
Member Avatar for nidheeshkumar.r

[QUOTE=nidheeshkumar.r;1756499]On execution i only gets a new window,its not displaying any images....i heard about grid layout,can i use that here?? wil u help me with some examples?[/QUOTE] maybe see here:[url]http://stackoverflow.com/questions/8500746/java-swing-displaying-multiple-images-dynamically-on-jpanel[/url] and here:[url]http://answers.yahoo.com/question/index?qid=20100704125651AAN0AUm[/url] [edit]and this too is helpful:[url]http://docs.oracle.com/javase/7/docs/api/java/awt/GridLayout.html[/url]

Member Avatar for JamesCherrill
0
1K
Member Avatar for Timlince55

[QUOTE=Timlince55;1740787]I need to print out a pattern that looks like this when N=6 1 21 321 4321 54321 654321[/QUOTE] use a for array and iterate through it saving each variable each time, but to the front of the string,this should do the trick with a little editing[code] String tmp = …

Member Avatar for nabanit.sarkar
0
241
Member Avatar for MrHardRock

[QUOTE=MrHardRock;1770427]Hey guys I had an assignment to recursively write the Towers of Hanoi then test it. I did not have too much of an issue getting the program written But I am not sure what the book means by test the efficiency do they want the number of moves my …

Member Avatar for stultuske
0
904
Member Avatar for DavidKroukamp

I have recently been interested in Java Swing and Game development, so naturally I began creating many different 2D games. During them I found myself having to rewrite much code, but eventually I decided to write some classes that would help me whenever I wanted to make a game. Here …

Member Avatar for JamesCherrill
3
2K
Member Avatar for Venkat SM

[QUOTE=Venkat SM;1753052]Can anyone tell me about [COLOR="Red"]how to create my own format[/COLOR] like .azw(kindle device format),.mobi,.epub etc..Is it possible to create it using java? if yes then what are the steps to do that? I am doing project for e-publishing company they need one own proprietary format like the above …

Member Avatar for peter_budo
0
2K
Member Avatar for SHAHAB UDDIN
Member Avatar for <M/>
-3
139
Member Avatar for DavidKroukamp

I have seen many questions on autocompeletion for *java text components* like `JTextField` `JTextArea` `JTextEditorPane` etc. There are not many options either: 1) 3rd party library (like SwingX) 2) DIY (i.e using `DocumentListener`, `JWindow` with `JLabel` etc and a few requestFocusInWindow calls) I chose number 2 and put the code …

Member Avatar for bguild
1
1K
Member Avatar for chonobob

[QUOTE=chonobob;1763055]Hey everyone, I have been assigned to create a recursive maze program and I am having trouble to figure out how to start it. I am pretty much lost and confused and don't know what to do. I do not want anyone to complete it for me but giving me …

Member Avatar for JamesCherrill
0
606
Member Avatar for Blink383

Im not sure what is the expected output, but I can see the discount JLabel (`sLAbel`)? ![kgfsd](/attachments/large/3/kgfsd.png "kgfsd") Please be more specific. A thing to note though regarding your code, no need for the `setVisible(..)` on `JLabel` as you dont call `setVisible(false)` you simply clear text. Also dont forget to …

Member Avatar for Blink383
0
286
Member Avatar for Hameeda0410
Member Avatar for jim.keele.7

The problem is here: System.out.println("Please enter income:"); income += key.nextDouble(); System.out.println("Please enter income:"); if (key.nextDouble()<0) { System.out.println("Thank you for using tax calculator, your total income entered is:" + income); System.exit(0); } else if (key.nextDouble() <0 || income <= 0){ System.out.println("Thank you for using tax calculator,the program will now exit"); System.exit(0); …

Member Avatar for jim.keele.7
0
139
Member Avatar for sunnyy221

Here are 3 great links that should answer your question: - [Why Java doesn't support multiple inheritance](http://javarevisited.blogspot.com/2011/07/why-multiple-inheritances-are-not.html) - [ Why not multiple inheritance?](http://www.javaworld.com/javaqa/2002-07/02-qa-0719-multinheritance.html) - [Why there is no multiple inheritance in Java, but implementing multiple interfaces is allowed](http://stackoverflow.com/questions/2515477/why-there-is-no-multiple-inheritance-in-java-but-implementing-multiple-interfac) **Some of the reasons being:** 1) Multiple inheritances does complicate the design …

Member Avatar for peter_budo
0
206
Member Avatar for ynmly

See [How to Use Combo Boxes](http://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html) has all you need to know there, Specifically [Providing a Custom Renderer](http://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html#renderer) than you woild simply call `setSelectedItem(Obejct o)` unless you can post an [SSCCE](http://sscce.org) of your current approach.

Member Avatar for stultuske
0
186
Member Avatar for JamesCherrill

To clarify, you would like to be able to drag a component from one JPanel to another or the smae panel? Also are you looking for DnD option only? Or custom too?

Member Avatar for JamesCherrill
2
1K
Member Avatar for 03hasnam

cross posted here: http://stackoverflow.com/questions/14171600/immediate-update-to-jcombobox-in-java/14171684#14171684

Member Avatar for DavidKroukamp
0
677
Member Avatar for jib123

Here is a small sample Swing GUI I made to get you started: ![Untitled95](/attachments/small/3/Untitled95.png "align-center") import java.awt.BorderLayout; import java.net.MalformedURLException; import java.net.URL; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.SwingUtilities; /** * * @author David */ public class SwingGuiTest { private JFrame frame; public SwingGuiTest() { initComponents(); …

Member Avatar for NormR1
0
1K
Member Avatar for Marty1963

dont think java has that as a built-in api, maybe look to using google maps api or another one that can take an ip and get current location? or you could just use the knowledge of an ip structure and get the location like that? : http://www.javaranch.com/journal/2008/08/Journal200808.jsp#a2. Also see here: …

Member Avatar for chrislim2888
0
152
Member Avatar for Banderson

[QUOTE=pokejef143;1751608]does this sorting method also capable in handling more than two arrays??[/QUOTE] i guess it does you'd just have to call it twice, once for each array to sort. but please as said above: If you have more questions please start a new topic.

Member Avatar for JamesCherrill
0
323
Member Avatar for slim.helu.92

You could import the com.samsung.util.AudioClip class into your java class. Then you can reference the java docs from the link below to see how to use it. http://www.j2megame.org/j2meapi/Samsung_API_1_0/com/samsung/util/AudioClip.html Keep in mind that you can only use .midi, .mmf, or .mp3 audio with this class. If you prefer making the code …

Member Avatar for slim.helu.92
1
190
Member Avatar for lj81

What exactly is your question? does your existing method work and you would like a more effecient way to do the name switching when balls are sunk? or does it not work?

Member Avatar for Philippe.Lahaie
0
418
Member Avatar for wallet123

found a nice site with an example for you to have a look at: http://www.rgagnon.com/javadetails/java-0426.html

Member Avatar for JamesCherrill
0
248
Member Avatar for JakeA

Well to disable it as in make it no more visible thats a bit hard (maybe impossible) why not add a `WindowListener` and then have [Iconified handler](http://docs.oracle.com/javase/7/docs/api/java/awt/event/WindowListener.html#windowIconified%28java.awt.event.WindowEvent%29) like so: frame.addWindowListener(new WindowAdapter(){ public void windowIconified(WindowEvent e){ frame.setVisible(false); } }); this will react when the `JFrame` is minimized and make it not …

Member Avatar for DavidKroukamp
1
2K
Member Avatar for FALL3N

> change the thickness of a Line2D Hmm this shoud help: import javax.swing.*; import java.awt.*; import java.awt.geom.*; public class TestLine extends JFrame{ private MyPanel panel; public TestLine() { setSize(200, 200); panel = new MyPanel(); getContentPane().add( panel, "Center" ); } public static void main( String [] args ){ TestLine tl = …

Member Avatar for FALL3N
1
658
Member Avatar for hszforu

public class JavaApplication186 { /** * @param args the command line arguments */ public static void main(String[] args) { Test.x("abc", 1, 2); Test.x("abc", 1.0, 2.0); } } class Test { public static void x(String s, int... i) { System.out.println("i " + i[0]); } public static void x(String s, double... d) …

Member Avatar for hszforu
0
166
Member Avatar for libathos

A quick google turned up this: http://wsdl2javawizard.sourceforge.net/ and for futher info: http://lmgtfy.com/?q=import+web+reference+eclipse

Member Avatar for libathos
-1
415
Member Avatar for yazz110
Re: JOGL

I'm not sure, what in specific you are looking for, but here's a great place to start: http://jogamp.org/wiki/index.php/Jogl_Tutorial

Member Avatar for yazz110
0
252
Member Avatar for DavidKroukamp

I'm not sure if I'm the only 1, but since the new site has been up, which looks great just took a while to get used to, reputation has not gone up (it has a little but not what it used to be). By this I mean, great users that …

Member Avatar for DavidKroukamp
0
268
Member Avatar for thanh_cong

Any questions or do you just want to share code? if so I dont think this is the place?

Member Avatar for Dani
-1
218
Member Avatar for antonis21

Yes I agree with stultuske, try make your Netbeans frame resizable, and see maybe if the JTable is added , just not in the place you though..... To add a panel to a Netbeans created frame i think you'd have to add your own code in the netbeans gui creation …

Member Avatar for dougWill
1
110
Member Avatar for karthikprs

Uhm how about the strings `substring(int startIndex,int endIndex)` or the ` lastIndexOf(String s)` methods. This is really simple, could you show some code you have tried? A quick [Google](http://lmgtfy.com/?q=extract+string+contents+java)

Member Avatar for karthikprs
0
2K
Member Avatar for raviaaaa

@stultuske, java has been exposed to having many flaws, leading to a great number of malware infections, which is still on the rise due to Java not being updated on many PC's. But I guess as lonh as you have a Good AV even though a virusmay use an exploit …

Member Avatar for DavidKroukamp
0
567
Member Avatar for aeshabana

Please give the full error message thats printed from the console.. with the line number and thrown exception etc and of course the section of code the error is pointing too

Member Avatar for DavidKroukamp
0
524
Member Avatar for ganges

Did you try a [Google](http://lmgtfy.com/?q=connect+html+form+fields+with+mysql+using+hibernate+example), or [this](http://facestutorials.icefaces.org/tutorial/hibernate-tutorial.html) might help

Member Avatar for DavidKroukamp
0
132
Member Avatar for blackmagic01021

Im not sure but I think [this](http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/JAXBUsing3.html) and [here](http://jaxb.java.net/nonav/2.2.4/docs/api/javax/xml/bind/Unmarshaller.html) and maybe [this](http://jpgmr.wordpress.com/2011/12/23/tutorial-unmarshalling-soap-maps-with-jaxb-into-a-list-of-objects-with-spring-integration/) HTH

Member Avatar for DavidKroukamp
0
741
Member Avatar for salina786

Im sure [this](http://codexamples.blogspot.com/2011/05/java-sms-send-read-with-smslib.html) and [this](http://sendsmsusingsmslib.blogspot.com/2009/06/how-to-send-sms-using-smslib-over.html) will help, they show how to send SMS using smslib in java, and here are the [SMSLIB Docs](http://smslib.org/doc/smslib/quickstart/), it would be goog to go through them.

Member Avatar for DavidKroukamp
0
105
Member Avatar for pooja.shinde

Have you tried appending cmd.exe to your query like this: "cmd NET TIME \servertosynchwith /SET /YES" I think that should work, you have to call command prompt with arguments which will be the "NET..."

Member Avatar for DavidKroukamp
0
157
Member Avatar for kaushik259106

I just have to say Jun 26th, 2008 7:20 am thread started, solved: January 24th, 2012 8:56 pm. :) now thats legendary lol

Member Avatar for ScottyKnows
0
1K
Member Avatar for Majestics

try these links im sure this will do: http://support.microsoft.com/kb/222092 , http://blog.mwrobel.eu/how-to-call-dll-methods-from-java/ , http://stackoverflow.com/questions/771145/how-do-i-call-dll-inside-java and http://www.java-forums.org/advanced-java/2064-how-call-dll-java.html and it seems you can use this really quick technique to load your dll use: System.load("C:/Windows/System32/yourdllname.dll"); or System.loadLibrary("C:/Windows/System32/yourdllname.dll");

Member Avatar for Majestics
0
229
Member Avatar for hasan101002

Hmm are you talking about the Encapsulation feature OOP languages provide? if so see just add the 'private' modifier to variables and methods that you want hide from other classes that may initiate your object. Note, if you use private modfier on variables that are needed in the calling class …

Member Avatar for hasan101002
0
104
Member Avatar for nikolaos

Hmm what LayoutManager sre you using? Most Layouts have a constructor that accepts the vertical and horizontal gap bewtween components: for example using panel = new JPanel(new BorderLayout(5,5)); will create a default BorderLayout with a 5 spacing for horizontal and vertical components or in your case maybe you are using …

Member Avatar for nikolaos
1
18K
Member Avatar for malsmit2014

Netbeans unfortuantely underlines the entire line making it hard to see where the error is! And as James said sometimes the IDE generated syntax error messages make things more confusing

Member Avatar for DavidKroukamp
0
306
Member Avatar for velr
Member Avatar for vinnitro

its basically telling you that you are using a deprecated api.. meaning : its an older class or method and that it might cause an error like a buffer overflow... http://www.javacoffeebreak.com/faq/faq0008.html my netbeans says: getText() is "Deprecated. As of Java 2 platform v1.2, replaced by getPassword." for lines 39 & …

Member Avatar for vinnitro
0
5K
Member Avatar for utkarshsahu

hmmm here is some code to help you out i didnt include the checkForWin() method procedures as its very lengthy... package tictactoetest; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; /** * * @author David */ class TicTacToe { private final JFrame …

Member Avatar for utkarshsahu
0
129

The End.