32,199 Topics
| |
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 … | |
[CODE] for(int x = 0; x < w; x++) { for(int y = 0; y < h; y++) { int rgb = bimg.getRGB(x,y); //byte r = (byte) ((rgb & 0x00ff0000) >> 16); //byte g = (byte) ((rgb & 0x0000ff00) >> 8); //byte b = (byte) (rgb & 0x000000ff); pixels[x][y] = … | |
Hello there Can anyone lend me a hand with this question? i'm seriously not looking for anyone to solve it for me, just a simple explaination will do. I'm having trouble knowing where to start, im just a beginner and this question really caught me by surprise, I don't even … | |
I have created a JFrame contaning a JTabbedPane. What I am trying to accomplish is the changing of tabs within my 'addCustomer()' class via an ActionListener. What I was trying was to call the method 'setTab(int c)' located in my 'BoatLog()' class, from my 'addCustomer()' class to set the index … | |
[ICODE]public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Input an integer: "); int n = in.nextInt(); int d = 1; int temp = n; while (temp > 9) { temp = temp / 10; d++; } System.out.println(n + " can be expressed in " + d + … | |
Hi! There is JTree component that I want to fill from the database. New nodes can be dynamically added to this tree. I need a procedure that will recursively traverse a tree. My problem is that [B]all nodes are added to the root node[/B], and sub-trees are not created. I've … | |
Hello - I have created a program which calculates the value of PI. All the calculations work well but the aim of the program is to get the user to input a number - say 7 and my program will print the value of PI to 7 decimal places. I … | |
[CODE]import java.io.*;public class Ex9a{ public void rollBack(BufferedReader in) throws IOException{ String line=""; if((line=in.readLine())!=null){ rollBack(in); } if(line!=null&&!"".equals(line)){ System.out.println(line); } } public static void main(String[] args) throws FileNotFoundException{ PrintStream out; Ex9a t=new Ex9a(); out = new PrintStream(new FileOutputStream("outfile.txt")); out.println(ioe); out.close( ); String fileName="infile.txt"; try{ BufferedReader in=new BufferedReader(new FileReader(fileName)); t.rollBack(in); }catch(IOException ioe){ System.out.println(ioe); … | |
Greetings reader, Thank you for your time. This post contains 2 Inquiries. My resources: BlueJ [B]Inquire 1:[/B] I would like to know what methods (if any) I can use to save anything generated by my BlueJ (e.g returned ints)to my PC's memory without having to create a .txt file somewhere, … | |
Vector v = new Vector(); i<10; v.add(new Integer(i));// what does this lien do? I dont understand, what does calling (`new Integer()`) do? Is is calling the constructor and passing the value i in it. Why can't we just pass the value i directly and add it in the vector. | |
Hello, for my University i need to develop a facebook application with JSP. So i wondered if anyone knows a Library (Like the official one for PHP) or any provide any other kind of help/tip for me? I found socialjava.com but it doesn't seem to work anymore. Or am i … | |
I need to do a program about: ask the user keep typing word until the word "stop" has been typed. my teacher said we need to add a class called Input. and he give the code to me. I have no idea how to use this code..any one can help? … | |
Hi there, This is just going to be a quick question. Also just note that I am i some "remote location" so I cant even show you my code. But what I want to know is this: Say you have a package called "myPackage" and inside that you have 2 … | |
Hello, I would ask if there is a possible method that would return a String in JAVA that I can retrieve the SQL code of any table on my embedded JAVA DB in my application. It is like the function of the phpmyadmin where in you can import a certain … | |
I'm supposed to create methods, but I don't know how to :(. All inputs and outputs should be done in the main method and calls to the methods should be done for computation. Can someone please show me how? Thanks. I have to do it on this program: (Actually there's … | |
Ok, I have been trying to write a program that will read in a list of positive integers (including zero) and display some statistics regarding the integers. This is what I have to do, [ICODE]After you have placed all of the integers into an array, your program should perform the … | |
Hi, I would like to FTP a file that only part of the filename is known. The name is something like “ClimateData2010042207XXXX.xls” performing the following does not work: [CODE] FTPClient client = new FTPClient(); FileOutputStream fos = null; client.connect("ftp.domain.com"); client.login("admin", "secret"); String filename = “ClimateData2010042207*.xls”; fos = new FileOutputStream(filename); client.retrieveFile("/" … |
The End.