32,199 Topics

Member Avatar for
Member Avatar for XodoX

Hello, I'm looking for a CSV parser and I found this example.... package com.ibm.ccd.api.samplecode.parser; import java.io.BufferedReader; import java.io.StringReader; import java.util.ArrayList; public class CSVParser { String oneRes; private String line = ""; private int nbLines = 0; private BufferedReader reader; public CSVParser(BufferedReader reader) { this.reader = reader; } public String[] splitLine() …

Member Avatar for Taywin
0
129
Member Avatar for charles.darwin

Hi guys. im writing a program to check an input string (a password) for its level of security (strong, medium, weak). here is my code for the method: public static int passwordType(String password) { //0weak, 1medium, 2strong int hasSix = 0; int upper = 0; int lower = 0; int …

Member Avatar for charles.darwin
0
156
Member Avatar for rachelmorg

hey this sounds like a really simple question to me but I can't seem to figure out how to do it! My code so far is public class numbers { public static void main(String[] args) { final int N = (args.length); for (int i = 0; i < N; i++) …

Member Avatar for rachelmorg
0
3K
Member Avatar for arcticman452

My program compiles but when I fun it I cannot get the city from the JComboBox to show in my JOptionPane. It shows up as "null" and when I click the clear button, nothing happens. I'm not sure how to fix these two problems. Here is my code: import java.io.*; …

Member Avatar for radhakrishna.p
0
160
Member Avatar for java123456

hey guys so i am having a problem in my assinghmnet . i am making a text file and it has to import to java and make a table from the text file . so there is what the txt file looks. 3 // this should be the rows 1,2,3, …

Member Avatar for subramanya.vl
0
260
Member Avatar for nseeley3

Hey everyone! So I want to make a simple console based chat client as my first java project (ambitious I know) so here is what I have brain stormed as to What this program will entail (Let me know if I missed anything. * Cases (to handle arguments such as …

Member Avatar for subramanya.vl
0
242
Member Avatar for jsp418

Hi. I'm writing a program that reads information from three seperate classes. public class Animal { protected int id,animalTotal; protected String type; protected double mass; //------------------------------------------------------------------------ // Sets up an animal with the specified ID number, type and weight. //------------------------------------------------------------------------ public Animal (int animalID, String animalType, double weight) { id …

Member Avatar for subramanya.vl
0
204
Member Avatar for nickcolb

So I'm working on a small calculator applet and whenever a button is pressed (generating an action event) i get this: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException. Something about a missing source? The variable m is an instance of my myFunctions class which houses all the necessary formulas. I believe the …

Member Avatar for radhakrishna.p
0
221
Member Avatar for Violet_82

Hi there, I am trying to find an explanation for what the `findWithinHorizon()` does. I landed on this page http://docs.oracle.com/javase/7/docs/api/ and I know that the method is part of the `java.util.Scanner` class (isn't it?). How do I find it in the page above please? thanks

Member Avatar for Violet_82
0
245
Member Avatar for aabbccbryanmark

package prjarrays; import java.io.*; import java.util.Arrays; import java.util.Collections; class BubbleSorting { public static void main(String[] args)throws IOException { BufferedReader a = new BufferedReader(new InputStreamReader(System.in)); int []num = {54,92,04,98}; -> Arrays.sort(num, Collections.reverseOrder()); for(int str : num) { System.out.print(str + " "); } } } > cannot find symbol method sort(int[],java.util.Comparator<java.lang.Object>) why …

Member Avatar for Ezzaral
0
130
Member Avatar for LdaXy

i'm writing a text based game that creates a world based on the data inside of the specified file. however, the code i have won't let me use the function DataInputStream.ReadFully(byte[]b) Code: package textgame; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.util.Stack; public class world { Stack<String> LevelData = new …

Member Avatar for stultuske
0
1K
Member Avatar for slimergan

Hi,I wish to simulate a traffic flow for a roundabout with 3 exits and be able to change how many cars enter and exit the roundabout and randomly turn off the exits. At a later stage I would also like to be able to input traffic lights to see would …

Member Avatar for JamesCherrill
0
99
Member Avatar for MistaGeorge

So this more than likely has a simple answer, but i cant seem to find it. I have a 2d array in one class, what I want to do is get this array into my other three classes. Now I'm not sure but I believe I have to use inheritance, …

Member Avatar for NP-complete
0
129
Member Avatar for jinxmc

import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; class oldEmployee { public static final int length = 0; static int empid[]={1,2}; static String Name[]={"name1",name2}; static String State[]={"state1","state2"}; static String City[]={"city1","city2"};; static String Area[]={"area1","area2"}; public Employee(int empid,String Name,String State,String City,String Area) { this.empid=empid; this.Name=Name; this.State=State; this.City=City; this.Area=Area; } public int getEmpId() { return …

Member Avatar for stultuske
0
204
Member Avatar for Atlanta15Braves

I am trying to switch the below code to sort in descending order rather than ascending. It works when counting upwards, but nothing I try helps with getting it to count starting with the largest number and count downward. public static void insertionSort(Comparable[] list) { for (int index = 1; …

Member Avatar for ~s.o.s~
0
746
Member Avatar for DEAD TERMINATOR

I'm trying to create a program that will draw an equilateral triangle with an oval at the center point when the mouse is pressed, and while the mouse is being dragged, the triangle will redraw itself so that the triangle remains equilateral regardless of where the mouse is (the mouse …

Member Avatar for DEAD TERMINATOR
0
319
Member Avatar for TheMrPatrick

Hi, I am currently making an assignment for JAVA, but I get stuck at the following. I need to make a simulation of a shop where a customer puts objects in his "basket" and with that basket you go to the checkout counter. Now we have to make it possible …

Member Avatar for NP-complete
0
560
Member Avatar for Nandomo

I have this assignment for my java class, it runs fine, but the professor wants us to incorporate a private gradeExam method, which I don't know how it work fit, since I cannot call it from the DriverTest class which contains my main. package project6; /* A demonstration of how …

Member Avatar for Nandomo
0
198
Member Avatar for shaneos

I posted this somewhere else but I think it was deleted so I'll post it as a new question... Here's my problem; I've been developing a packet sniffer using the Jpcap library from http://netresearch.ics.uci.edu/ . I was developing using the windows version of the java library, but now I realize …

Member Avatar for shaneos
0
492
Member Avatar for sania khan

Is it possible to get location in form of text through Google map using Android java?

0
63
Member Avatar for Violet_82

Hi there, as one of my first programs in java, I thought I will do a simple (!) lottery program...needless to say it doesn't compile, and after looking at it for quite awhile trying to unsuccessfully spot the error (I am not sure how to debug in netbeans, any advice …

Member Avatar for Violet_82
0
13K
Member Avatar for asif49

Hello, My problem is that I have a class, which needs to extend either one of two classes - the one it should extend depends on some value that is determined during runtime. I understand that there isn't a concept of having an if (this condition) extend thisclass else extend …

Member Avatar for stultuske
0
89
Member Avatar for nvijay
Member Avatar for stultuske
0
154
Member Avatar for myadav

Hi All... I am new to java, I am facing problem... Problem: 1) I want to create a ArrayList <String> and add Strings into it. problem: 2) I want to compare two Array List elements . their size and contents (strings type) which may be stored in any order. For …

Member Avatar for myadav
0
366
Member Avatar for arcticman452

I have the main part of my code done but I don'T know if I should use an action listener or an event listener for my JComboBox. I have 4 JComboBoxes and only need to retrieve the info from my vehicleBox and fuelBox at this point. I need to take …

Member Avatar for jalpesh_007
0
200
Member Avatar for arcticman452

I cannot get this to show up when I run it and I can't figure out whats wrong. import java.applet.*; import java.awt.*; import java.awt.event.*; import java.text.*; import javax.swing.*; public class TravelCostEstimator extends Frame implements ActionListener,ItemListener { //This part defines how the program will look Panel partOnePanel = new Panel(); Label …

Member Avatar for arcticman452
0
210
Member Avatar for Inori

This is a project I am working at my school as an introduction to two dimensional array. In this program, I attempted to create a two dimensional array, figure out how many neighbouring bacteria said cell have, and create, destroy, and leave the cell as it is. The error I …

Member Avatar for stultuske
0
184
Member Avatar for harinath_2007

I'm having tough time with netbeans. I am trying to add external image files to the netbeans project but confused where to place them. I copied the image files in every folder of netbeans(as i was tired) but nothing worked. Where exactly I should place the external resource files(images,videos,auidos etc)..

Member Avatar for harinath_2007
0
89
Member Avatar for dqddani

Hi, I would like to make a window with a given size, and a scrollable textarea to a given place within. When I tried the same with a button instead of textarea, it was no problem: make a JFrame, put a JPanel inside, put a JButton on the panel. Then …

Member Avatar for subhraakasuny
0
262
Member Avatar for angel sunflower

i hav a shopping cart in java he columns of jtable are code-the item code qty-the quantity enterd by the user i want to update the quantity in database .the description of the table is code -item code stock-total stock in hand. i need to to update the quantity by …

Member Avatar for angel sunflower
0
972

The End.