32,204 Topics
| |
Two classes which aim to demonstrate private and public members of a class. A static variable is used as an accumulator to keep track of the number of class objects which are created. | |
A program combining a switch statement with static variables in a class. Based on the switch statement, a class object is dynamically created. | |
Nothing fancy, but I know many new programmers are often confused about recursion. Recursion simply is when a method calls itself. What MyTree does is it adds nodes to the root node, then that root node can be used to create a JTree. The populate() method reads in a list … | |
| |
Here is a code to sort numbers instead of strings using the BubbleSort method. The difference here is you don't use compareTo() for numbers as you do with strings. | |
Hi Dani, fine Examples (the others too) to learn programming Java, but where is the MyInput.java class? Thanks Eddi | |
This program consists of two functions in one class. It demonstrates a recursive function to calculate the factorial of a number. | |
I am having an issue with my program. If I select one of the three calc buttons it works fine and shows the amort table correctly. If I put information in the text fields for amount, interest, and years and hit calculate button I get little boxes in the amort … | |
I am writing a small Java program and need help using a simple search code. It is not compiling. [CODE]public int indexOf(EltType e) { int i=0; for (i = currsize; i < currsize; i++){ things[i] = e; e.equalts(get(i)); } return -1; }[/CODE] Basically I want to get the position number … | |
Hi, I need already written code for a simple file and folder explorer in Java similar to Project Explorer in Net Beans IDE. Instead of writing it from scratch I hope I can find which is already written. It will be very good if it allows file/directory add, remove and … | |
I am trying to design the game Bulls and Cows we have a word to guess eg:"fame"(four lettered) if i type abcd bulls=0 cows=0 efgh bulls=0 cows=1 (if the letter is at the same positon as the word we give bulls. If the letter is in the word but not … | |
I Don't want to use keyListeners anymore since it's there's too many unfixable bugs with it. [B][U]Problem#1[/U]: I am now trying to have a Label say "Enter a consonant" and beside it a textField that should be the size of one character. I tried setColumns(1) but it won't work and … | |
To say that I am not offended at being called "incompetent" in what i thought was supposed to be a friendly forum would be lying. [B]I stated long ago that i was NEWBIE to java. [/B] All i meant by my original post was why not MAJORITY of people can … | |
Hello Everyone, Can you please give me some thoughts on how to create a folder in http(Ex: [url]http://localhost:8080/site/myfoldertocreate[/url]) instead in a local drive (Ex. C:\MYFOLDER) Here is the current code that I am using. [CODE]public static void createFolder(String Folder){ try{ File f = new File(Folder); if(f.mkdir()) SimpleLog.write(Folder + " Directory … | |
Hi: I was wondering if anybody knew anything about creating your own programming language. Thanx | |
may someone give me a sample code of loop within a loop, and other that I may use for decision in my program. | |
Hi, I have installed netbeans to work on java. I heard that we can simply drag and drop buttons,radiobuttons, and all and we need not write the actual java program.But I am unable to find how can i drag and drop. can any one help me. Thank you. | |
Hi!!!!!! I am facing a problem at the run time of the java byte code. I am using JDK 1.5 in OS Win XP on and i have installed it properly... its compile time is working exactly i.e. javac command produces byte code but when i use command java class-name … | |
I need a diversion, and I was wondering. What would be a good library to write? It's somethings that I've wanted to do for a while, just never gotten around to. I was thinking about a lib for some of the methods that I often use, just much more generalized … | |
I need help. I dont know what to do next to get the following output: groceries.csv: (file needed to input at command prompt (args)) Name, Number natto, 3 eggs, 12 shiitake, 1 negi, 1 garlic, 5 umeboshi, 1 (need to output as shown below): number of integers in file "groceries.csv" … | |
Hello everybody, Infact this Alarm.java (attached) using sun proprietary API sun.audio classes, now these are deprecated so i want to replace it with java se 6 classes. This Alarm.java is beeping the PC but not able to run alarm.au(attached)audio file and gives Following exception Exception Occurred....java.lang.IllegalArgumentException: No line matching interface … | |
Hi guys, Posted about a week ago saying I was re-learning Java and slowly making my way from basic console stuff to 2D graphics. Well after a good deal of learning about applets and threads, drawing 2D shapes, and double buffering, I decided to remake "Pong", at least a crappy … | |
I have my game [url]http://blogfriendlyzone.webs.com/wof/WOF.html[/url] and i tried to share it with some online friends but some complain that they can't even spin the wheel or they can't enter a consonant (after spinning wheel):-O . It won't accept their consonant from the keyboard like it should. Is there something i … | |
I am trying to create a postfix evaluator that uses my IntStack and IntNode class. I cannot figure it out. HELP PLEASE! public class IntStack{ private IntNode top; private int counter; private IntNode pos; public IntStack(){ top = null; counter = 0; } public boolean isEmpty() { return (top == … | |
In class I have to create a java program that has to use the user method. Here is my code. 1 import java.text.*; 2 import javax.swing.*; 3 import java.io.*; 4 public class Fahrenheit3 5 { 6 public static void main (String [] args)throws Exception 7 { 8 String inFahrenheit; 9 … | |
hey guys, I want to develop a web application using Java but i don't know where to start from. From where i should start learning and what all should i learn?? | |
hi please i deperately need help been trying to compile this code on netbeans IDE but it keeps giving me error on the output code is: package gameapplication; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Vector; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; /** * … | |
Hi this is a decompiled version of a guessing game which i am required to submit in assignment. can anyone please make it run anyhow. i hav also attached sample from which i generated code any help will be appreciated. Thanks [code=language] // Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas … | |
Hello, I am working on a code which should execute any *.exe file in java. I have used a sample code which works for UI based application but do not work for command prompt applications like cmd.exe or mysql.exe. Please advise for the improvement. Thank you in advance. Here is … | |
im working on this java program: Create a Java program that creates six random numbers between 1 and 10 and for each randomly generated number it displays the text describing the number rather than the numerical value. For instance, if the number generated was 3 then it should display three; … |
The End.