35,618 Topics
![]() | |
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 … | |
I wrote some html code that lets the user choose an input from a drop down menu then it is passed into a servlet and that creates an HTML document with the output. How does the servlet get the input from the user. In other words, what code do i … | |
| |
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 every body. i am a new user to this site and i need help from you all regarding installation and running of tomcat3. Can any body give me step by step details of how to install and configar tomcat and then where to save a simple java program containing … | |
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! | |
Hi all, I have a test tomorrow morning and I'm stuck on this one question on my review and here it is: 1. Write a method that takes an integer n, and returns a String. Assume the integer n is an odd integer between 1 and 9. If the returned … | |
Hi...I have created a browser using JAVA. But I cannot access any of the google or yahoo websites. I can access only a few select websites like cs.bham.ac.uk etc.... Can anyone tell me the reason and probably the solution as well..? | |
hey guys, i was wondering if anyone could help, basicly at the moment (for the last few hours) iv been tring to find a way to align an container, to enable me to have my current work on one side (left or right) and a JTextArea on the other. the … | |
HI, From the following code: [CODE] 1 import java.util.*; 2 3 public class t2 { 4 public static void main(String[] args) { 5 List aList = new ArrayList(); 6 7 aList.add("a"); 8 aList.add("b"); 9 aList.add("c"); 10 aList.add("d"); 11 12 List bList = new ArrayList(); 13 14 bList.add(aList.get(1)); 15 bList.add(aList.get(3)); 16 … | |
I have a java aplpet in eclipse. How do i get my java applet to load in an html web page. I put the .class file from the bin director in the same directory as my web page. I tried applet tag but it gives me an empty white box. … | |
Dear all, I have a test tomorrow and I just wanted to double check on my answer for this review question. Write a method negativePositive that takes an array of integers, and returns an array that contains 3 integers. The first value in the returned array is the number of … | |
Can someone please explain what both of these mean and the good details about them. Please also explain the parameters of how to use it. | |
I have a GUI window with a JFrame. On this JFrame, I have a JPanel that completely covers the JFrame. I then have another JPanel within this first JPanel that contains a text box and 3 buttons. Within an event handler, I want to expand the JFrame and 2 JPanels … | |
hiii can u please help me in uploading files in JSP??? I have a code but it can only upload small sized files(only few bytes or kb) , please help me in uploading large files.I tried to upload a large file but it could not, although it didn't show any … | |
When I start NetBeans I get a dialog with the following: [QUOTE][B]Cannot locate java installation in specified jdkhome: C:\Sun\SDK\jdk. Do you want to try the default version.[/[/B]QUOTE] I click Yes and everything seems to work ok. Now, I did have the SDK installed but didn't have any need for it, … | |
I need to make multiple action listeners for 4 radio buttons and a regular button. They all need to call different methods from another class I currently have [CODE]Import javax.swing.*; import java.awt.*; import java.awt.event.*; public class CardGameCH15 extends JFrame { public CardGameCH15() { super("Card Game"); add(new CardTable()); } public static … | |
I need to build a simple GIS or map view component for a larger system for my Final Year Project. But I have no prior experience in the field. Therefore I need to add this component as a additional feature only and with the least amount of effort and time. … | |
Well I was just wondering what should be the first step of making a project(school or professional). Ohkay we've conceived it all. But i just make a garbage of ideas. How to make them bit neat n clear. What shud be the steps, a developer should take before going for … |
The End.