Posts
 
Reputation
Joined
Last Seen
Ranked #284
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
~325.05K 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
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 Ram_034
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
699
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
238
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
138
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
604
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
285
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
203
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
185
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
151
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
322
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
186
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
415
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
247
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
648
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
164