32,199 Topics

Member Avatar for
Member Avatar for k2k

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 …

Member Avatar for masijade
0
86
Member Avatar for scott3487

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; …

Member Avatar for scott3487
0
138
Member Avatar for Gurmehar

can any guide me how to use jtapi haow can us handle an incoming call use jtapi

Member Avatar for peter_budo
0
35
Member Avatar for redZERO

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 …

Member Avatar for Ezzaral
0
109
Member Avatar for Thirusha

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 …

Member Avatar for dickersonka
0
78
Member Avatar for Grub

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 …

Member Avatar for javaAddict
0
124
Member Avatar for tactfulsaint

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.

Member Avatar for peter_budo
0
59
Member Avatar for rathinam86

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 …

Member Avatar for javaAddict
0
321
Member Avatar for stefen04

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 …

Member Avatar for javaAddict
0
121
Member Avatar for sbhavan

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. …

Member Avatar for masijade
0
86
Member Avatar for cproud21

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. */ /** …

Member Avatar for darkagn
0
82
Member Avatar for k2k

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 …

0
68
Member Avatar for redZERO

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 …

Member Avatar for redZERO
0
108
Member Avatar for Cosmocrazy

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. …

Member Avatar for Ezzaral
0
96
Member Avatar for gur

can anyone tell a program to calculate d number of objects in a program?

Member Avatar for stultuske
0
90
Member Avatar for chinni1201

hi guys,, can anyone post the entire coding for A* algoritham using heuristic functions..u hav to use java langauge..

Member Avatar for peter_budo
0
27
Member Avatar for l_03

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..

Member Avatar for peter_budo
0
186
Member Avatar for atularora66

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 …

Member Avatar for atularora66
0
103
Member Avatar for rtrader

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!

Member Avatar for Ezzaral
0
112
Member Avatar for bobrien314

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 …

Member Avatar for Ezzaral
0
98
Member Avatar for Mackjan

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 = …

Member Avatar for Mackjan
0
100
Member Avatar for Hockeyfreak889

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

Member Avatar for masijade
0
70
Member Avatar for janustt

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 …

Member Avatar for janustt
0
120
Member Avatar for silentone190

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 …

Member Avatar for silentone190
0
171
Member Avatar for peter_budo

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 …

Member Avatar for peter_budo
1
145
Member Avatar for dimples09

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 …

Member Avatar for Ezzaral
0
105
Member Avatar for pardeep3dec

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 …

Member Avatar for mangel.murti
0
160
Member Avatar for ymf

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 …

Member Avatar for peter_budo
0
192
Member Avatar for PoovenM

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 …

Member Avatar for PoovenM
0
123
Member Avatar for MrDiaz

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 …

Member Avatar for MrDiaz
0
188

The End.