32,199 Topics
| |
if i have an array initialized to hold 500 objects : [code]Object array[] = new Object[500][/code] but i only populated certain number of objects in the array... ex: 300 of them array.length will give me 500... how do i get the number of the used array? (it would be 300 … | |
I am trying to make a frame with a label and a button and cannot get it to work. Im not sure what im doing wrong. [code]import java.awt.*; import java.awt.event.*; import java.io.*; import java.lang.*; public class Program3 extends Frame implements ActionListener, WindowListener { private static final long serialVersionUID = 1L; … | |
can any guide me how to use jtapi haow can us handle an incoming call use jtapi | |
Hi I'd like to use an array to store values of particular things. I would like names to correspond to each value in the array. What I was thinking was, should I perhaps create 2 arrays: String[] and int[]. Then, when I call data from say example_int[1] I call the … | |
Is there a way of changing the username and password used to connect to the db in a connection pool, or do i have to create a new connection pool with the new username and password. I do not want to hard code the connection string thats why i want … | |
Hi. The program I am writing is for a mac and am doing so in Java. I am writing a program that finds Identical files or very similar files, not necessarily identical but very Similar. Now I can thus far compare files by name but some files are identical but … | |
i need help with JTable, i want to use it to view the informations from my database but i dont know how to do that. would apprecitae help from anyone. | |
Hi Cud anybody help me in sorting out this issue???...i have written a java code which fetches a text fils as an input & displays the output. Now i want to display the output in an existing Excel file in a desired format. import java.io.*; class hi { public static … | |
I am a student who is taking a computer science course in college and have been assigned to write an algorithm for a java program. I have no previous programming experience and I am really behind in this class. It seems fairly simple and anyone on here could probably do … | |
I want to understand the JDBC thoroughly (i.e. all 4 types of drivers). Any body can help me in the following. I have searched for the resources to clear this for the past 6 months. But I can't able to clear these. 1. Difference between the 4 types of drivers. … | |
I need to print the following array and am not sure how to do so. It uses an object which is already created named TimeAT.... i mport java.util.Scanner; import java.util.Random; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** … | |
hi, as far as I know if i wanna read external text document, i can either do: [code] BufferedReader reader = new BufferedReader(new FileReader("xxx.txt")); or Scanner reader = new Scanner(new File("xxx.txt")); [/code] my first question is, what is the difference between BufferedReader and Scanner? And what is the difference between … | |
Hi again What is the name of the component in programs where there is: a 2 character text field and on the side there are up and down arrows to increase or decrease the value in the text field. There is usually one in the "Print" dialog in MSWord, with … | |
I don't think this qualifies as cheating on homework. I am making a Java applet that will input the name of a teacher at our school and output their schedule. When I say schedule, I mean the times they teach and what classes they teach, and where they teach them. … | |
can anyone tell a program to calculate d number of objects in a program? | |
hi guys,, can anyone post the entire coding for A* algoritham using heuristic functions..u hav to use java langauge.. | |
hello guyz,,do you know best sites to recommend on : tutorials about reading a file ("text file") and writing it in "java file?? in short reading or writing files in bufferedreader.. thank you ahead guyzz.. | |
I'm new to java and we have to create a program telling the user how much of their income will be taxed based on rates given out by the government of Canada. I am getting 2 errors, one saying that "variable federal might not have been initialized" and the other … | |
I have a generic static inner class inside a generic non-static class. It gives me errors because E cannot be accessed from a static context: [CODE] public class List<E>{ public static class InnerClass<E>{ } [/CODE] How do I fix this? Thanks! | |
I am writing a code to read in a mips file to look for data dependencys, but when i read the file in i get all kinds of goofy stuff coming in as well, thanks in advance for any help. [code=java] import java.io.*; import java.util.*; public class hw { static … | |
What dose it means at Dice.rollDice(Dice.java:30) java.lang.IllegalArgumentException: n must be positive at java.util.Random.nextInt(Random.java:250) at Dice.rollDice(Dice.java:30) my code is : [code=jva] import java.util.Random; public class Dice { // instance variables. private Random mRandom; private int mSides; /** * Constructor for objects of class Dice */ public Dice(int sides) { sides = … | |
How would you make it so that you check if the user has pressed the keys up, down, w or s every half a second | |
I'm not sure where I'm going wrong in this program. I needed to create two different classes, one being the driver class the other the utility class. The purpose is to ask the user for the circle's radius, creating a Circle object, and then reporting the circle's area, diameter, and … | |
Hello. I am new at this and I'm having trouble getting a total from multiple data. What i need is a total for a final summary. How do i calculate this? i have searched and read many text on this subject, but have had no luck... some how i get … | |
I created menu for mobile phone, where after you make move screen should be repainted and after that a sound should be played. However at present stage sound is played first and just after that Canvas view is repainted. Bellow is skeleton of the class [code=Java] public class ContactMenu extends … | |
This is the main of my program all errors have been solved now I need help sorting my array list with a selection, bubble and insertion sort to print out in alphabetic order using the name as key numeric order using the income as key order of nationality in alphabetic … | |
Dear Friends, Here i am giving my programme coding and error. file name - MyCanvas.javaimport java.awt.*; import java.applet.*; public class MyCanvas extends Applet { public MyCanvas() { setSize(80, 40); } public void paint(Graphics g) { g.drawRect(0, 0, 90, 50); g.drawString("A Canvas", 15,15); } } When i use command javac MyCanvas.java … | |
I'm trying to get a GUI application to display an image. So far I've got this bit of code: [CODE=java] import javax.swing.*; import java.awt.*; public class DemoImage extends JFrame { public void showImage() { // creates the actual frame with title 'My GUI' and dimensions JFrame frame = new JFrame("My … | |
Hi guys, I'm not really sure how to ask this or what to even search for. I want to write a Java program that can feed data into another program. If the other program had command line parameters then I'd know what to do, but suppose the program I want … | |
Hi, I'm wondering how I can accomplish this. Suppose I have the following array [CODE]String[] randomText = {"hi", "hello", "hey there"}[/CODE]; If I want to print the array I only know how to do so line by line. [CODE]for (int num = 0; num < randomText.length; num++){ System.out.println(randomText[num]); }[/CODE] Can … |
The End.