32,204 Topics

Member Avatar for
Member Avatar for BrianK123

This is probably just a stupid mistake but I can't figure it out. I have this code: [CODE]TextField passGet=new TextField(10); passGet.setEchoChar('*');[/CODE] and when I try to compile, I get and <identifier> expected error. Anyone know why?

Member Avatar for BrianK123
0
1K
Member Avatar for Chaster

Yellow, From my application - for some reason - I am able to send messages up to only 64k. I've been wondering if it is possible to split an InputStream into partitions of 64k, and then, on client side to join them again. Is this possible? Have you ever done …

Member Avatar for BestJewSinceJC
0
82
Member Avatar for Johannady2

number = 10; sum = 0; for (var i=1; i<= number; i++) { sum = sum + number; } document.write("sum = " + sum); number = 10; for (var i=number; i > 0; i--) { if ( i%2 == 1) document.write(i); } product = 1; number = 5; for (var …

Member Avatar for verruckt24
0
113
Member Avatar for viber101

hi I would like to know if it is possible to display the line number in a JTextArea? I design an editor using NB ide and I'd like to offer the same features like Text Editor that show the number of EACH line at the left side of the text. …

Member Avatar for Ezzaral
0
62
Member Avatar for BrianK123

I was writing an applet before and was displaying information in a JOptionPane. Useing \n, I was able to make the information display multilined like this: [CODE]Name1 Grade1 Name2 Grade2 etc.[/CODE] I unfortunately had to change my code from an applet to a JFrame and subsiquently my Labels to JLabels. …

Member Avatar for BrianK123
0
189
Member Avatar for mona515

I've been tryin to figure out how to pick numbers from the 'choices array' and put then into the results array. Can any body help me. I was thinking of adding a for loop but not sure. The code i got so far is below. import java.util.Random; import java.util.ArrayList; public …

Member Avatar for notuserfriendly
0
82
Member Avatar for gpittingale

I have called some numbers from a mysql database, they come out like this: [CODE]${parish.TotalHouseholds}[/CODE] Now what i would like to do is take the TotalHouseholds and TIMES it by 21.33% and display the answer in a separate cell and i was wondering if anybody could give me a plain …

Member Avatar for gpittingale
0
79
Member Avatar for shahab.burki

Hi, Can we declare Char Array in Java instead of String Arrays? So we can manipulate them? or we have to use Strings and then use charAt() method for it? Thanks

Member Avatar for stultuske
0
145
Member Avatar for k2k

hi, i actually had done similar programs many times and don't know why eclipse gave me strange output this time. anything possibly wrong? thanks [code] class RobotShop { public static void main(String[] args) { try { Scanner reader = new Scanner(new File("air.txt")); String robotName = null; String serial = null; …

Member Avatar for stephen84s
0
113
Member Avatar for aodpreacher

Hi i have a java class called City and in this class i have this. [CODE] public class City { /** * read the file and make 10 objects * */ private String name; private double population; public City(String name, double population) { super(); this.name = name; this.population = population; …

Member Avatar for BestJewSinceJC
0
134
Member Avatar for transplantedNYr

So I am going through the "Getting Started Using Java RMI" and I get stuck at the following spot... [CODE] [B]javac[/B] -d [U]destDir[/U] Hello.java Server.java Client.java [/CODE] I use... [CODE] [B]C:\"Program Files"\Java\jdk1.6.0_11\bin\javac [/B] -d [U]C:\"Documents and Settings"\"Andrew Carrara"\Desktop\test\mysrc\example.hello[/U] Hello.java Server.java Client.java [/CODE] I get an invalid flag error. What exactly …

Member Avatar for transplantedNYr
0
131
Member Avatar for Andrewsc1

Im new to java and just trying to figure out the basics. i cannot figure out what is wrong with my program. Any suggestions on whats wrong? [code]4import java.util.Scanner; 5 6public class Lottery 7{ 8 public static void main(String[] args) 9 { 10 //Generate random lottery numbers 11 int lottery …

Member Avatar for Andrewsc1
0
141
Member Avatar for youngstorm

Hi, I have an int method that checks an array for a certain number. If that number is NOT found I won't to 'return null;'. I get this error "incompatible types" "found : <nulltype>" "required: int" How can I resolve this? thank you, Michael

Member Avatar for youngstorm
0
125
Member Avatar for scott_rider

Is there a method I can grab parent/grandparent nodes? The examples I have found appear to use only xpath statements to select nodes. Some of my failed attempts: /table/tr/td/b/font[self::text()="Nohup Files"] /table/descendant::font[self::text()="Nohup Files"] <table> <tr> <td><b><font>Nohup Files</font></b></td> </tr> </table>

Member Avatar for Ezzaral
0
101
Member Avatar for Y2K_MASTER

Hey guys, I'm making a program that takes 3 sets of coordinates from a user to make a triangle. It then calculates the length of each side, the perimeter of the triangle, the area of the triangle, and the 3 angles. I have it all coded, except for the area …

Member Avatar for Y2K_MASTER
0
156
Member Avatar for gpittingale

Hi everybody, i am new to java and trying to develop a bit of an app i have created the first page, dynamicall filled a dropdown box all is fine i press the submit button and i get the error below: java.sql.SQLException: Parameter index out of range (1 > number …

Member Avatar for gpittingale
0
165
Member Avatar for jpp10

I have the following code, which reads from the .csv file and simply displays the output as whatever is being read from the .csv file...(which is test1.csv in the test1.zip attached with this post) //class to read CSV file : import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; public class readCSV { …

Member Avatar for jpp10
0
179
Member Avatar for l_03

[ICODE] import javax.swing.*; public class Tokenize{ public static String s[] = new String[100]; public static void main (String args[]){ String ask = JOptionPane.showInputDialog("Enter:"); isAsk(ask); } public static void isAsk(String ask){ StringTokenizer st = new StringTokenizer(ask," ",false); int input = Integer.parseInt(st.nextToken()); if(input<=10&&input>=0){ System.out.println(input); } } } [/ICODE] Here is the sample: …

Member Avatar for verruckt24
0
166
Member Avatar for janakavishwajit

Hi alll............. Please can someone help me to find a way to call for a c# function from a javascript which is in the web page of web browser included in a windows application....... Urgently need....... Please............!!!!!!!!!

Member Avatar for janakavishwajit
-1
88
Member Avatar for guatemalagirl

the purpose of my program is to ask the user for their numerical grades (depending on how many total grades they have) and then they are given their letter grade. but i cant get the for loop to loop the question according to their number of total grades [code=JAVA] import …

Member Avatar for verruckt24
0
270
Member Avatar for bebe11bebe

I have two other classes but they are very small, and this is where the error lies. This is my code: [CODE]import java.util.Scanner; public class Player { private boolean isHuman; private int score=0; private Scanner input; public Player(int human) { System.out.println("If you would like to play, press 1. Otherwise, press …

Member Avatar for r.stiltskin
0
121
Member Avatar for BrianK123

does anyone know why this does not work? [CODE]public class AddStudentListener implements ActionListener { public void actionPerformed (ActionEvent event) { //Changes title Title.setText("Add Student"); //Obtians student information from the user Object[] possibilities = {"IB Computer Science", "AP Computer Science", "Algebra II"}; StudentClass = (String)JOptionPane.showInputDialog(All, "What class is \nthe new student …

Member Avatar for sillyboy
0
107
Member Avatar for trelek2

Hi! I'm writing a program thats due tomorrow and I have a problem with one aspect: I can draw the picture I want and everything using paintComponent, but then when the user pulls the edge of the window, the program should resize the whole picture- redraw it i guess... How …

Member Avatar for Ezzaral
0
110
Member Avatar for oldSoftDev

I am trying to read some numerical values from a file and getting this error: Input Error: Error in input: Floating point number not found.; Expecting Real number in the range -1.7976931348623157E308 to 1.7976931348623157E308 [code][code=java] import java.io.*; public class TriangleMain { /** * @param args the command line arguments */ …

Member Avatar for Ezzaral
0
91
Member Avatar for EJD

The following code is producing this problem (typed with exact characters printed in command prompt, aside from quotations): "Please input D for a daytime movie or E for an evening movie: This is not a valid choice." The program will not allow me to input anything following the prompt for …

Member Avatar for EJD
0
107
Member Avatar for olgratefuldead

I'm having some trouble with my code. I want to calculate the final balances of some movie tickets based on their day or night showing (and depending on if they are children or adults). So at the end of the code, I've been trying to get the solution to a …

Member Avatar for olgratefuldead
0
239
Member Avatar for olgratefuldead

I need to figure out how to set my overall ticket limit (aticket + cticket) to 100 and if a customer goes over the limit, then they are told that they have ordered too many tickets and that they need to try again and then it loops back through until …

Member Avatar for olgratefuldead
0
90
Member Avatar for BrianK123

What I am trying to do is read from a file to an ArrayList and then display it using a JOptionPane. The only problem is the code i am having trouble with is in an ActionListener and I believe somehow I have created an infinite while loop because when I …

Member Avatar for verruckt24
0
171
Member Avatar for crzycrusnik

Hello! First time Poster :) I'm trying to create a Java Web Crawler. What I want it to do is pass the crawler a starting site, a max depth/levels of sites to go to (as opposed to number of pages) and save files like images and documents. The problem is, …

Member Avatar for verruckt24
0
226
Member Avatar for kuldeep_java
0
13

The End.