32,199 Topics

Member Avatar for
Member Avatar for hanntaa

hey guys im not quicke sure this progrom wont send the string "result" to the JList, something im doing wrong? any help would be great thanks [CODE] import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.util.*; import java.io.*; import javax.swing.*; import java.sql.Array; import java.text.*; public class Q3 implements ActionListener { JFrame …

0
74
Member Avatar for scjavastudent
Member Avatar for ramjeev
Member Avatar for maddy1985

requirement CSCI690 - Multicast Socket Programming Project [Objective] Develop a multicast client program to work in conjunction with a multicast test stream. [Requirements] The multicast client must be able to join any group/port, that is specified via the command line. E.g., mclisten <multicast group> <port> where multicast group is a …

0
76
Member Avatar for DanieL34749

I am currently working on a program that manipulates strings passed in as parameters using strictly recursion. Right now, I am stuck trying to print the word out vertically. [CODE] public static void printVertical(String str) { if (str == null || str.equals("")) { System.out.print(""); } else { char nextLetter = …

Member Avatar for mrnutty
0
66
Member Avatar for saadismail85

[code=java]import java.util.Scanner; public class Exam_Test { public static void main(String args[]) { Scanner input =new Scanner(System.in); int number; System.out.println(" Enter a Number : "); number = input.nextInt(); for (int i = 0; i <= number; i+=2) { for (int j = number; j >= i; j--) { System.out.print(" "); if …

Member Avatar for Grn Xtrm
0
90
Member Avatar for ramjeev
Member Avatar for masijade
0
191
Member Avatar for muraliinfy04
Member Avatar for Ashutosh shukla
0
701
Member Avatar for Bluesilver

I need help on an assignment I have. The first part was to write a program that would declare an array with 150 elements, assign the "#" symbol to each element, then print the elements in such a way that it would spell a letter (in this case, "A") within …

Member Avatar for BestJewSinceJC
0
98
Member Avatar for .11

Hey everyone... Well I am sorting items based upon a number. My first case is if tail == null, if so that the first element to be added in the list. My second case is if the element I want to add number is greater than the tail. If so …

Member Avatar for .11
0
127
Member Avatar for leoeroy

I need help with my java program. I can't seem to figure out how to print my output in 10 numbers and then go to the next line. For example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 here's my code [CODE] …

Member Avatar for leoeroy
0
107
Member Avatar for halona

hi .. I want to display an error if the user didn't enter the id or the password in the Text fild.. but nothing happed when I compare it to null .. or to "" .. is there any way to do this? I also tried to compare it with …

Member Avatar for chaines51
0
110
Member Avatar for denni2727

At the moment Im developing a java application but Im having a problem. Im using a JFrame that takes different JPanels, I mean i change its ContentPane for another JPanel everytime i want to show new information. Im using a database too, im reading data from it im writing them …

Member Avatar for denni2727
0
219
Member Avatar for micpalmia

Hi everyone, this is my first time here and this is my problem. I have an URL like this [url]http://tinysong.com/aGFW[/url] that, if called, redirects on [url]http://www.grooveshark.com/song/Human+To+A+God/20790261[/url] that is a RIA that, after charging, plays a song (an unique song, and after that it stops) I would like to reproduce this …

0
48
Member Avatar for PuffyCloud

[CODE]import java.io.*; import java.util.Scanner; public class pa4 { public static void main (String[] args) { int i; boolean loop = false; do { Scanner inFromFile = null; try { inFromFile = new Scanner(new FileInputStream("words")); } catch (FileNotFoundException e) { System.out.println ("Could not open the file"); System.exit (0); } Scanner in …

0
74
Member Avatar for Beasts

I was wondering if I can create an arraylist with info already in it... Ex... ArrayList playerinfo = [P0,[[1,2,3],[4,5,6]]] If that makes sense. The info I want in the arraylist will always be the same, as it will be what I am using to test my program. However I need …

Member Avatar for Beasts
0
77
Member Avatar for aj.wh.ca

Sample code for taking input from Shell demonstrating string and int input For simple programs or testing purpose its not always required to take input thru GUI.

Member Avatar for javaAddict
0
237
Member Avatar for hanntaa

hey guys i was wondering if someone could help, i have to create an address book in java that can add, delete, search as well as import details from a file. so far iv got the GUI down (ish) iv set it over 2 frames, one to edit the data …

0
81
Member Avatar for Beasts

I am taking a Class on Java, and sadly the professor is not all that good. But we have a project to do... I have got to a point where I need to pull info out of an arraylist... But it is an arraylist that is made up of arraylists. …

Member Avatar for Beasts
0
130
Member Avatar for hanntaa

hey guys i was wondering if anyone could help. im trying to add the name, address, home number, mobile number to a JList but i can only seem to save each item to a new line. any help would be great! thanks [CODE] else if (e.getActionCommand() == "Save") { this.details.addElement(this.textName.getText()); …

Member Avatar for Ezzaral
0
101
Member Avatar for P00dle

The line I get an error on is this: [CODE]List accDetails = (List)tm.get(accNo)[/CODE] "tm" is a TreeMap, and "accNo" is a value in it. accNo is a String. I get a build error like this: java.lang.String cannot be cast to java.util.List I have no idea what to do here, I've …

Member Avatar for P00dle
0
183
Member Avatar for Ezwhe

You can call me Ezwhe. I'm a computer science student. I'm acquainted with Turbo C and Java but still has a lot to learn. For me, Java and Turbo C are as exciting as they are challenging. I'll try my best to be active in our forum. More power to …

Member Avatar for Ezwhe
0
93
Member Avatar for fawkman

Hi guys, I am working on a conversion of the Mandelbrot Fractal from Java to C# and my programming skills are lacking quite a bit. I am desperately trying to improve but I have come across some errors that are stumping me. I have attached a txt file with the …

Member Avatar for fawkman
0
653
Member Avatar for egoverbey

I'm working on a program for school and I need to send an array into a method. I have the following in Main: String list = printLine(arrayList[ ]); And the following is the start of the method: public static String printLine(int[ ] a) Why won't arrayList[ ] plug into the …

Member Avatar for kvprajapati
0
39
Member Avatar for P00dle

I want to add a String to a list, but I get the error [B]Type mismatch: cannot convert from String to List[/B] Initially I did it as follows:[code] List accDetails = tm.get(accNo); [/code] and then like this:[code] String conv = (String)tm.get(accNo); List accDetails = conv; [/code] Both have the same …

Member Avatar for P00dle
0
155
Member Avatar for vijay_mca

i have created jar file when i am double click jar file i got error could not find main class program will exit i am setting jar properties file mycomputer->tools->folderoptions->filetypes->jdk->javaw i have created manifest file also i am using windows xp operating system can anybody tell wha t is the …

Member Avatar for kvprajapati
0
87
Member Avatar for gunjannigam

I want to draw a battery meter. For this I am painting my panel with Filled Rectangles using AWT Graphics class. Is it possible that I can add a tooltip so that whenver a mouse is pointed on the top of the rectangle a text is displayed(which will be the …

Member Avatar for gunjannigam
0
643
Member Avatar for nojtb

[CODE]import java.util.Scanner; class ReverseWord { public static void main(String args[]) { Scanner myScanner = new Scanner(System.in); char c1, c2, c3, c4; c1 = myScanner.findInLine(“.”).charAt(0); c2 = myScanner.findInLine(“.”).charAt(0); c3 = myScanner.findInLine(“.”).charAt(0); c4 = myScanner.findInLine(“.”).charAt(0); System.out.print(c4); System.out.print(c3); System.out.print(c2); System.out.print(c1); System.out.println(); } }[/CODE] the code above if you type stop in the windows …

Member Avatar for valy0017
0
267
Member Avatar for skiplatte

Hi, is there a way to read in a file to give a string which is passed to the method without reading line by line? I need to read in something like this... 1 MLRLPTVFRQ MRPVSRVLAP HLTRAYAKDV KFGADARALM LQGVDLLADA 51 VAVTMGPKGR TVIIEQSWGS PKVTKDGVTV AKSIDLKDKY KNIGAKLVQD 101 VANNTNEEAG DGTTTATVLA RSIAKEGFEK ISKGANPVEI …

Member Avatar for P00dle
0
76
Member Avatar for nola_Coder

Well, I just solved the problem I was having. A small and stupid error on my part. If there's a way to delete threads, let me know!

0
64

The End.