32,204 Topics

Member Avatar for
Member Avatar for plasticfood

here is some code from one class... [CODE]public boolean ticketStatus(){ if (fine > 0){ status = true; } else{ status = false; } return status; } [/CODE] and this is from another class... [CODE]public void getTicket(){ if (parkingticket.ticketStatus()){ toString(); } else{ System.out.println("you do not have a ticket. "); } } …

Member Avatar for Taywin
0
118
Member Avatar for sureshksk

Hi all, I am using java bean class in my web application(it is not extending servlet).My need is to get the context path of the application in that class.If yes how. I am using "./".It doesn't work. Please help me

Member Avatar for sureshksk
0
68
Member Avatar for atticusMom

Currently working on a project where we have a message board server. I've gotten most everything to work except my last part where we want an arrayList that returns Oldest Messages and one for newest messages. Here is what I have so far and have tweeked and commented out some …

Member Avatar for Taywin
0
118
Member Avatar for RaghadAsfar

Hi, I need to know if we can use the if satament with methods and how? and what is the illegal start of expression?

Member Avatar for javaAddict
0
78
Member Avatar for shamagantu

The problem: Java will not install on my laptop. My laptop was purchased a little over three and a half months ago. It is an eMachines 440-1394; Windows 7, two Gb RAM, 250 Gb HDD When I purchased the laptop, I was able to install openOffice (with Java? I am …

Member Avatar for apines
0
313
Member Avatar for lykathea

I am trying to implement a stack where one can push to the front and to the back of the stack. However, my implementation is very slow. Can anyone help me think of a better method? Thank you! [CODE]public class Pch11_x1 { /** * @param args the command line arguments …

Member Avatar for lykathea
0
116
Member Avatar for muncher10

I can't seem to find out why it doesnt work with average or smallest but largest and sum does work. //constructor public class DataSet { private int sum = 0; private int count = 0; private int Smallest; private int largest; public DataSet() { } public void addValue(int a) { …

Member Avatar for apines
0
157
Member Avatar for Buffalo101

I'm using a JTable with a DefaultTableModel. I use the Load Button for populating the JTable. Anyway, the problem I have is with the Delete row button. (defaulttablemodel.removeRow). This is the whole project: [code=java] package proiect1; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import java.io.*; import javax.swing.event.*; import javax.swing.table.TableModel; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; …

Member Avatar for Buffalo101
0
433
Member Avatar for Mona..

Hi.. this is my code: [code] import java.util.Scanner; public class Arrays { //private variables private int[][] list = new int [12][2]; private int highest; private int lowest; //public functions Arrays(){ highest = 55; lowest = 5; list = new int[12][2]; } public int getData(){ Scanner input = new Scanner(System.in); for …

Member Avatar for Mona..
0
153
Member Avatar for mangopearapples

How can I develop IPhone games with Java? I've tried something called XMLVL but that doesn't seem to be up to date and I can't use it because they don't have anything I can download to use... So is there any other alternative?

Member Avatar for mangopearapples
0
126
Member Avatar for hwalsh

I can't get my userName variable right, it prints out user name the first time, but the second time it prints out null...I've been at this same problem for nearly 24 hours. [CODE]import java.util.Random; import java.util.ArrayList; import java.util.Scanner; public class mlab { // instance variables - this instance will get …

Member Avatar for hwalsh
0
85
Member Avatar for kezkez

if i have a text file with data: test, 1, 2 again, 3, 4 Can someone give me an idea how to start puting each line into an object ? ObjectName o = new ObjectName(String s1, String s2, String s3); [CODE] class Action implements ActionListener { public void actionPerformed (ActionEvent …

Member Avatar for JamesCherrill
0
153
Member Avatar for Judas3213

hi everyone, i need some help implementing some functions into my code. Right now, all it does is have a rectangle appear on the screen and I can change its color via the radio buttons. I'm thinking I need some sort of grid/cells on the left side of the panel. …

Member Avatar for Judas543
0
76
Member Avatar for blknmld69

I am having problems with the output of my program The program is to design a classed named Employee. The class should keep the following information in fields: Employee Employee number in the format XXX-L, where each X is a digit within the range of 0-9 and the l is …

Member Avatar for peter_budo
0
60
Member Avatar for hannon565

When I try to run the file I get this error, amen't sure how to fix it. [CODE]Exception in thread "main" java.lang.IllegalArgumentException: illegal component position at java.awt.Container.addImpl(Container.java:1035) at java.awt.Container.add(Container.java:408) at EmailWindow.CreateContent(EmailWindow.java:65) at EmailWindow.<init>(EmailWindow.java:22) at Lab6a.main(Lab6a.java:10)[/CODE] Heres my code sorry for lack of comments [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public …

Member Avatar for sakshamsak
0
1K
Member Avatar for wobuaini

hey, can anyone help me with these comlexity problems? I tried with myself but still want some clarifications..cheer,here is the code: [CODE](a) public void printPow2(int[] values) { for (int i = 1; i < values.length; i *= 2) System.out.println(values[i]); } (b) public void maxDifference(int[] values) { int max = 0; …

Member Avatar for apines
0
156
Member Avatar for khaled_jawaher

i want to know how to put the path in the fuction Naming.lookup ("//...."). suppose that i want to call the remote object in 2 cases: 1. server and client stands on local machine for example remote object and sever stands in folder c:\rmi i want the exact path please …

0
67
Member Avatar for v30

Hey guys, I'm new here and a n00b in Java, trying to figure things out though :) I want to make a polygon move in a Java Applet but I keep struggling with the keylistener (aka it doesn't do anything) Maybe someone can help me please? Here's my code: (I'll …

Member Avatar for apines
0
145
Member Avatar for Sunshineserene

Hi, I have a text file that I'm going to read, and then parse it. After parsing it, how do I return it into it's original position or layout as before? Because now after parsing it, my output is printed out individually, instead of printing it out how it looks …

Member Avatar for Sunshineserene
0
206
Member Avatar for Protoroll

I am writing a toString method where a it returns three integers. If any of them are less than ten I have to add a zero before the number. For example if I had the variables 5, 6, and 2 it would read 05:06:02. I really can't figure out how …

Member Avatar for Buffalo101
0
104
Member Avatar for DallasFan3

Hey, Iam trying to write a java application that acts as a one-word Pig Latin translator. The program should: 1.ask the user to enter a word 2.convert the entered word into proper Pig Latin translation, (I have to use a method named translate to get the Pig Latin translation of …

Member Avatar for peter_budo
0
717
Member Avatar for seekdestroy

Ok, I'm getting a little confused on how to do this. Basically i got N stacks of cards. And need to check the topCard of every stack and check that N - 1 cards match then remove them. I peeked every stack of cards to get the top card, and …

Member Avatar for apines
0
13K
Member Avatar for DallasFan3

Right now Iam writing a program that will convert english into piglatin. Ans I have pretty much finished the program, but Iam stuck and need help. When I run the program, nothing happens after I type in the users input. What am I doing wrong. Heres my code, [code]import java.util.Scanner; …

Member Avatar for kezkez
0
1K
Member Avatar for CompSci_Guy

My question is... what is the int times for? i dont understand what i am supposed to do with it. Here are the instructions about this method: String[] generate(String symbol, int times) In this method you should use the grammar to randomly generate the given number of occurrences of the …

Member Avatar for Taywin
-1
1K
Member Avatar for jems5

I am writing a program that reads text but must ignore case, spaces and punctuation while evaluating a string for palindrome. When I use the following the case issue is solved. [CODE] String str = ""; if (str.toLowerCase().charAt(LHS) != str.toLowerCase().charAt(RHS)) [/CODE] ...but when I use the following I get IndexOutOfBoundsException …

Member Avatar for jems5
0
3K
Member Avatar for Awesomeness

I have an application I'm making... And it has a canvas in it. The problem is, on the y axis, my canvas is offset by ten pixels downward and I can't figure out why. You can see what I'm talking about in the screenshot. Do you know what's wrong?

Member Avatar for Awesomeness
0
117
Member Avatar for 123a

Hi, i only know the Java basics and really need help! I have a class called temporaryHolder which holds an arrayList of 54 cards. However, I need to get elements out of this arraylist and need to add them to stacks in another class. Q1) How can I access all …

Member Avatar for 123a
0
75
Member Avatar for LianaN

Hi! I've decided to open a new thread for discussing the problem with uploading a file to a SUB-FOLDER at the FTP Server. So, I'm using Apache Commons library and I can upload my file to the Home Directory of the FTP server. However, if I want to upload it …

Member Avatar for LianaN
0
1K
Member Avatar for o0oKodako0o

I have this problem when i create a sortable JTable with data load from an ArrayList! My project is Student Management and i add some function like Add/Edit/Delete infomation. With unsortable JTable, add/edit/delete function is ok, but with sortable JTable, when i click on the header of one column, that …

Member Avatar for peter_budo
0
52
Member Avatar for nichu

i am doing a desktop application using netbean6.8 how to show error message if i didnt enter mobile number textbox pls help me....

Member Avatar for apines
0
91

The End.