32,204 Topics
| |
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 … | |
[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? … |
The End.