32,204 Topics
| |
trying to finish a code given by sir which was to add the preorder and post order in thr tree but i am getting an error with the preorder so need help. [CODE]public class BinaryTree { BinaryTree left; BinaryTree right; int value; public BinaryTree(int v){ value= v; } public void … | |
copy in your program and then run.. [CODE]void Ubaid(int x)[/B] //this is function x value is 5 or directly set x=5 { // x=5; for(int i=x;i>0;i--) { printf("\n"); for(int j=1; j<=i; j++) { printf("%d",j); } for(int u=i-1;u>0;u--) { printf("%d",u); } [B]}[/B] //start another from here that print the opposite for(int … | |
(Think this is a java problem!!!) When I print a result set of a mysql query it doesn't print the 1st value. I used ResultSet rs = stmt.executeQuery("Select * from names"); while(rs.next()){ textAr.append(rs.getString("name")+"\n"); } This prints the values from index 2.. How can i print all the values.??? thankx in … | |
Guys, Im having trouble working with Jcombobox. I have this action listener in Jcombox that would get the ID of the current selected item which is a query from my db. here's my simple code: //clientName is the variable I declare for my JCombobox. private void clientNameActionPerformed(java.awt.event.ActionEvent evt) { //db … | |
I wanted to create a graph of connected nodes (eg- node 1, 2, 3. 1 connected to 2 and 2 connected to 3). How can I do this? I searched and found that JUNG (the Java Universal Network/Graph Framework) can be used to draw such graphs. But I am unable … | |
My teacher said that we needed to perform 3 mathematical actions on the chars so it works when I encrypt the textboxes but then it doesn't work when I decrypt them. I think it might be the order of my math operations in the decryption code? For example: I put … | |
need help with a homework problem and i've been starring at code all day and my brain is fried... any advice or pointers would be greatly appreciated Description of the Problem Write a method minimum3 that returns the smallest of three floating-point numbers. Use the Math.min method to implement minimum3. … | |
If I have an application written in Java, how can I make it available for purchase/download on my website? Namely, how do I obscure the source code so it can't be viewed, yet enable it to be executed by any machine (including ones that don't have the JVM installed)? | |
I have two graphics methods in my program. One for the menu and one for the game. I have previously written all of my code in one graphics with a bunch of nested ifs. Now I am trying to separate the two. Is there a way to call the gameGraphics … | |
Hi, This application does everything but show the circles and rectangles even though visible is set to true. [CODE]package Shapes; import java.awt.*; import javax.swing.*; public class ShapesTest { public static void main (String []args){ String input = JOptionPane.showInputDialog ("Enter 1 to draw rectangles\n" + "Enter 2 to draw ovals" ); … | |
I've run java programs in Command Prompt before and it worked, but today I tried and it's saying: 'javac' is not recognized as an internal or external command, operable program or batch file. I am running Windows Vista and have four (4) files under Java: jdk1.6.0_23 jdk1.6.0_24 jre1.6.0 jre6 Umm, … | |
I made the 4 buttons with top, move up, move down and bottom. But I took open the files for test.txt in LJist and it won't move it How do I add something. I will show you the code. And I saw Error for to press move down, it won't … | |
Hi, im trying to create a GUI which will house a BST. When the user enters a number and clicks add, it should display that number as a leaf in a BST. It then adds each consecutive leaf onto the last to create the BST. My problem is actually getting … | |
Hello, I have a program that has three text areas, and I'm going to add an image viewer. My question is how to save and load the text and images so that when the user clicks 'save' it will save a file with the text and images, and when the … | |
Hi, I am having trouble having the answer increment, I know it seems the increment value is lost in the method but I cannot find a way to make that work, can you please give some suggestions. Thanks. This program is supposed to ask the user to enter sales amount … | |
there is a problem with java code i need your help plz as soon as you can [CODE]import javax.swing.*; import java.io.*; /** *Homework #1 CaesarCipher.java *program to encrypt and decrypt stuff */ public static void main(String[] args) { ceasar1 cc = new ceasar1(); public class ceasar1 { public String dataencyptS, … | |
| Hi all, I'm writing a webcrawler as part of a search engine project at university, and have been using jsoup to my advantage. This connects to a page and neatly takes all the href's from anchor tags for me. However, when I add these to the arraylist of URLs waited … |
Hi, Can anybody tell me how can i set attributes of frame or components in a frame in ActionListener of a button. Regards. | |
I am trying to build a compiler using Java Code. I am stuck at the Lexical Analyzer Stage and am not getting the output I want. The Code: 1)Lexical Analyzer [CODE] public class LexicalAnalyzer { int lexemebegin; int state; Symbol tokenValue; TokenType currentTokenType; String Shura; int lineNumber; int position=-1; String … | |
Hi ,I am trying to catch exception if integer is out of certain interval ,how can I do that. Lets say that float variable has to be in the interval 2 to 5 in all other cases exception Thanks | |
Hi, I am rendering a bunch of cg images but now I need to make an applet that will view them. More specifically these images are very much like the first generation of google street view where you have a picture and you can get a camera to crop a … | |
hi i am trying to execute mysql stored procedure from java program but when i call that procedure CallableStatement stmt = con.prepareCall("call readFloor()"); it produce java.lang.NullPointerException at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(StringUtils.java:948) so how can i remove this error readFloore() is sample stored procedure it return nothinh i tried this example whith another stored … | |
OK, so here's my assignment...ask the user for a sentence, then print each word along with its position in the sentence. Then ask for another sentence... if the sentence is empty, terminate. My code works... but I don't know how to get it to loop back to asking for another … | |
I have written my first class and I was given a driver program to test my class it might seem silly but how do I run the driver file to test my class Description: Java Class Die that will manage a roll of a six-sided die. The Class will include … | |
Greetings Everyone. :) My question is, is there any website which has intermediary java programs, i am concentrating on importing classes, Methodoverloading, Constructors and etc, i want some guidance with various examples, Do you have any suggestion? Adv Thanks, Susheel | |
Can anyone change this to polymorphism? it is a simple program. no calculation at all. but the problem is, everytime i'll try to use polymorphim or extanding the classes, error occurs. actually i wish this program is in polymorphism structure, but im not really good in it(polymorphism). [code] import java.io.*; … | |
hi, im trying to make a bike move by using the pedal() method, the method will move the bike forward a distance of half the circumference of a wheel. ive tried creating the pedal() method however when the method is invoke the position of the bike is still the same. … | |
[CODE]TreeSet goodWords = new TreeSet(); ... Iterator iterGoodWords = goodWords.iterator(); while (iterGoodWords.hasnext()) { String word = iterGoodWords.next(); System.out.println(word); }[/CODE] Tell me, why doesn’t that print anything even if there are some items in the goodWords collection? I know there are items in the set because when I check the size, … | |
hi, v converted a .mov video file to an .avi file using a online converter. When v try to play it by creating a Player object, it says the error: Unable to handle format mp42. We have typed the code in netbeans 6.9 and it works fine for other .avi … |
The End.