35,619 Topics
![]() | |
I am trying an example from my CS class. We learned recursion recently, and one of the examples I was given was to reverse a given string. The Java program compiles correctly, but when it is actually executed, instead of getting the intended result, I get this as my outcome. … | |
I'm doing active rendering for a game, and I was wondering,,, Does drawing outside a canvas still use just as much CPU? As in, If I draw one rectangle, and then draw another outside the canvas, does it ignore the other rectangle, or waste CPU on it? I want to … | |
Hello there! I am new to Java and DW, though I usually find great help already here! Say I need a constructor that accepts [COLOR="red"]variable number of parameters[/COLOR] up to 2 parameters, but if I pass only one parameter to this constructor, both parameters will take this number, and if … | |
Hi, I've been working on this for two days. I need to pass an arraylist to another class. It gets the information, and will print out the menu, until the program goes back to the initial class, then the list empties. I don't get it, and I'm so confused. [CODE]public … | |
Hi! I want to delete an empty directory from FTP Server, however my code works only for files. Let's say the root directory in my FTP Server is called as [ICODE]Documents[/ICODE]. I want to delete a directory [ICODE]Director[/ICODE]. Then I execute [ICODE]client.deleteFile("\\" + selectedPath);[/ICODE], where [ICODE]selectedPath[/ICODE] is equal to [ICODE]Documents\Correspondence\Finance\Director[/ICODE]. … | |
Hi! How should I change the TableModel that extends AbstractTableModel to allow displaying empty data sets? Should the getValueAt method be chaged as follows? [CODE] public Object getValueAt(int row, int col) { Object str = ((Object[]) cache.elementAt(row))[col]; if (str != null) return str; else return ""; }[/CODE] ...or something else … | |
Hi! how could I delete all spaces in the string: [ICODE]String str = "AAA BBB CCC";[/ICODE] in order to get "AAABBBCCC" as a result? The following doesn't work: [ICODE]str.replaceAll(" ", "");[/ICODE] Thanks! | |
hi i got one problem to solve am almost did but facing problem for my last for loop iteration can any one help me this is the problem i received University of Newcastle School of Electrical Engineering and Computer Science SENG1110/6110 Programming Assignment 1 – Semester 1, 2010 Due: By … | |
Hey guys, I have a problem I can't seem to figure out properly: I have to implement a mirror in a java applet. For the mirror I used a second window. what I don't know: -how to rotate the second window -how to make it mirror what's in front of … | |
Hello folks, For my final project I decided to write an online poker game. Long story short I'm having trouble with a class I wrote to manage java.net.Sockets. The source for this class is: [CODE] import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.util.Iterator; import java.util.LinkedList; public … | |
**CHANGE PANELS IN TITLE TO Grid Layout I first want to apologize for filling the board with a noob question but I don't know how to phrase my question on google. So here we go! My prof has us working on GUI programming. I am trying to split up my … | |
Ive been trying to make a program that should keep the status of a hotel room layout. main method should return this: [url]http://img202.imageshack.us/img202/969/layoutview.jpg[/url] the cells should also be painted green if they are available for renting Yellow if they are booked or red if the are not available one class … | |
hi everyone i am working on internet banking project. I have an little idea about the project what are the functionality to implement and I am not perfect in web technologies. But I'll work hard on this project. My major problem is I am not getting where to start it … | |
An error called outofmemory error is coming up when I am giving nums value > 1. I have underlined where num comes. The strings bla1, bla2 etc, I gave for identifying the error. private void generateMouseClicked(java.awt.event.MouseEvent evt) { String s = new String(); String o = new String(); boolean check … | |
I have written a piece of code, everything is fine until i run it, i get [CODE]"Exception in thread "main" java.lang.NullPointerException at useCADSL.main(useCADSL.java:5)"[/CODE] i know what it means, i just cant see where to modify [probably the whole you read what you think you've wrote thing] my first class is … | |
Hi everyone, I know you probably see a hundred of these during this time of year, but I have a project going at uni that requires us to create a string based hangman game from scratch. It's not anything fancy, and the game itself isn't too complicated, but where I'm … | |
| |
helo everyone......... could anyone of you please explain me the concept of ARRAYS. another doubt.........can anyone of you just give e the basic lgic ofbinary search, linear search, bubble sorting an selection sorting!! specially binary search and linear serch the concept i have not understod proprly!! and a smal program … | |
Hi guys, i have a String time 23:00, how do i subtract it against a String today's time and get the remaining minutes? do i parse the String into a date type? any ideas is appreciated, thanks. [CODE] public String getTime() { SimpleDateFormat sdf = new SimpleDateFormat("kk:mm"); Date s = … | |
Hey, I have a problem and am hoping that you can help me find a solution. I have a site created in dreamweaver. To do this, I made a template, with 2 editable regions, then set up all my pages. The problem I am having, is that I am trying … | |
i've posted a thread about reading xml file from remote machine. i've used JDOM to read xml file.bcs as someone has told me,it is really easy and flexible.now i am using it normally in local machine.i've opened a socket connectio between server and client machine.then i use JDOM to read … | |
Hi guys. I've just installed libnetty-java package on my ubuntu $ sudo apt-get install libnetty-java and then try compile this code [CODE] import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.ExceptionEvent; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.SimpleChannelUpstreamHandler; ... [/CODE] It throws this error: javac QuoteOfTheMomentClientHandler.java QuoteOfTheMomentClientHandler.java:1: package org.jboss.netty.channel does not exist import org.jboss.netty.channel.ChannelHandlerContext; ^ QuoteOfTheMomentClientHandler.java:2: package org.jboss.netty.channel … | |
Hi, I'm currently trying to create a program that will log into the web page given to it if supplied with the user name and password. but the problem im having is sending the POST request to the website and then retreiveing the URL it sends back to load in … | |
hi, im doing a project on j2ee, live project.but, i dont know, from where to start with.i would like to know creating a forms in j2ee. is it similar to jsp. how to connect to a database with netbeans,etc... in a website based project or live project. im waiting for … | |
Q1: CommissionReport class JavaAuto is a used car dealership that pays its sales associates by sales commission. Your application will produce a sales commission report as shown in the example screen shots. Your solution will contain three classes. The MyArrays class will contain several static methods for searching, sorting and … | |
I need help the word class for a hangman program here is the code i have so far: /** * File: Word.java * */ package csc212project05; import static java.lang.System.out; import java.util.ArrayList; import java.util.Scanner; public class Word { private static java.util.ArrayList<String> wordlist = null; private char[] lexeme = null; // the … | |
![]() | I need to change this from a bubble sort to a selection sort but i don't know where to start. Also I don't understand the difference between the two sorting methods, and which one would be more efficient. Thanks [CODE] import java.io.*; import java.util.Scanner; public class phase1 { public static … |
hi, i am final year student and i need to start on my project in 3 weeks time. Wel i love programing with java and i need to learn more on the depth area's.So doing a project using java will help me a lot. So what i am asking u … | |
Hi there, I am getting a 'Cannot find symbol error' on an array in my "ViewContact" Class. The array has been created in the "MainScreen" class. Below I have pasted the code for both classes as to provide you with as much information as possible: The MainScreen Class: [CODE] package … | |
Hi everyone! Im trying to fill up a tree with the entries from a text file and I can read the file and I know how to make a tree object. I just dont know how to combine these two to populate the tree. Any ideas are appreciated! | |
[B]Hey guys! I'm doing another school project, bleh ._. The method I need help on is called isFlush. It's a boolean that needs to determine whether the hand (subDeck) is a flush or not. A flush contains five cards with the same suit. I want to know how to just … | |
Hi all, Im trying to run a simple applet which prints a message to the screen..The applet runs fine on applet viewer but when i try to view it in the URL bar i get the following error: load: class Test.TestApplet.class not found. java.lang.ClassNotFoundException: Test.TestApplet.class at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown … | |
Hello, My assignment is to create a christmas tree using methods with defined parameters. 1) Print the tree at position 50 (50 spaces in) 2) Call the following Triangle (2,6) (six rows without the first 2 printed) 3) and the 1st row of these cut off triangles with the symbol … | |
I'm working on a really basic text editor to save and open txt files. On my text area setLineWrap, it's giving me a "misplaced constructs" and "delete token" for the period and (true) For why? [CODE]/**Matthew Schrum *11/18/2010 */ import java.awt.*; import javax.swing.*; import javax.swing.border.*; import java.awt.event.*; import java.io.File; import … | |
Hi! Could someone please explain me the difference between the following three approaches to inserting nodes in JTree? I cannot understand why the insertNodeInto method doesn't work in the recursive procedure (Approach Nr1), but it works if it is executed from JButton (Approach Nr2). So, Recursion itself (Approach Nr1) works … | |
hi guys, good eveningn, ive been trying for two days now and i haven had no luck with this, im trying to compare 3 arraylists to filter by town, and age and show all the peoples names specifically from that town, heres my code any help would be appreciated. heres … | |
Hi I am trying to extract some information from data base and i am writting this query [CODE]java.sql.Statement s = dbCon.createStatement(); ResultSet r = null; r = s.executeQuery("select * from emp where description="+courseName);[/CODE] If the course have value description="Fundamental of Science" then it says "syntax error at or near of" … | |
How would I go about converting a string to an integer? Say someone enters a 4 digit string. Like 1234. Could I use the place of each digit and work with it? Pretty much, I wanna get 1 from the string "1234" and put it in a variable. Then get … ![]() | |
Hi All, I'm looking to create video transition using java. I'm wondering if JMF is a good way to go..since I had a bad experience finding competiable format that is supported by JMF. The idea of my project is basically feed any two given video. when reach to the end … | |
Okay so I have an array of Objects.. My goal is to get the output to print every "Song" the user inputs But for some reason only the last song in the array is printing which is confusing me [CODE] import java.util.*; import java.util.Arrays; public class SongRunner1 { public static … | |
I just dont know where to start on this. Can anyone lend me a hand? 4- Write a Java program to create the following array that hold the salaries of employees: 1550.8 2439.5 1800.75 2890.0 The company wants to give the employees a bonus of 30% of their initial salary, … | |
i want project titles related to computer science in latest language but i want to do projects in .net & java | |
hi, so i've been looking for a string matching algorithm that gives me a "rating" based on how close the 2 strings match.. luckily, i googled and read this article: [URL="http://www.catalysoft.com/articles/strikeamatch.html"]how to strike a match[/URL] here's the original java class code [CODE=java] package strike_a_match; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; … | |
Hello, First of all, I hope my post isn't breaking any of the forums' rules Here's my code so far [CODE]import java.util.Scanner; /** * * @author user */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = … | |
my program doesn't work correctly because this exception [CODE]while(count<sharedBetweenThreads.size()){ for (int i = 0; (i < ourThreads.length) && count < sharedBetweenThreads.size(); i++) { if (ourThreads[i].isAlive() == false) { ourThreads[i].start(); } }[/CODE] if the length of an array of threads(ourthreads) equal 2. the two threads start and then the program check … | |
Hi Guys I am a Computer Science student at University and am looking for some ideas on a project that I have to complete. I have to come up with an hypothetical Software engineering problem in Java , I have to create a bad way of solving it and then … | |
hi, I am doing an instant chat system using java client and server architecture. currently im implementing the server side of it. my question is: Should i design a gui for the server side as well? if yes what kind of functionality should I include? thanks | |
hello guys, like the thread title i want the best book to learn J2ME with no java experience and i got some knowladge in c/c++ and can i finsh that's book in 2 weeks maximum? thanks my regards... X | |
Hello everyone, Please look at the following code block, [code] public void Foo() { synchronized (lock) { //do task 1 try { lock.wait(); } catch (InterruptedException e) { // TODO Auto-generated catch lock e.printStackTrace(); } //do task 2 } } [/code] Suppose multiple threads have entered the synchronized block one … | |
Hi, I'm having trouble finding the right code to write a short method to create a greyscale SImage from an array of ints representing text in binary form. For example, given the array [0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 1], an … |
The End.