32,199 Topics
| |
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 … | |
| |
Why String comparison with '==' is illegal,eventhough it works fine.Kindly explain? | |
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 … | |
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 = … | |
[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 … | |
How can I use Mysql for JDBC connection.How to make data source? I can able to done with MS-SQL. | |
hi all, i want to display some data in dropdown from database using java.please send the code | |
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 … | |
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 … | |
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] … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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. | |
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 … | |
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. … | |
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()); … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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! |
The End.