32,204 Topics

Member Avatar for
Member Avatar for mxa92

Basically, the game goes like so- User types a word they want player to guess (I've done this) each letter in the word is displayed by "-"'s (I've done this) Player guesses a letter in the word (I've done this) Check guessed letter with each position in the word (I've …

Member Avatar for hfx642
0
134
Member Avatar for asif49

I'm attempting to iterate over a list and when a chosen value is found remove it but I can only remove 1 value (the first one found). Why is this and how can it be solved. Here's the code I use [CODE] for (int i = 0; i<list.size(); i++) { …

Member Avatar for asif49
0
675
Member Avatar for asif49

I have an Employee and a Job class, only up to 10 employees can be attached to a job so I store all the employees doing a specific job in the job class within a List (of max size = 10) The problem is, that the program is meant to …

Member Avatar for JamesCherrill
0
202
Member Avatar for popsyjohnson

[CODE]//package import java.util.*; // the main class BinaryToDecimalCalculator public class BinaryToDecimalCalculator { public static void main(String[] args) { Scanner input = new Scanner(System.in);//scanner object for input //declaration of input variables int binary, exponent=0; float decimal, total=0 , currentNumber ; boolean error =false;//check for input errors //the user inputs a binary …

Member Avatar for Ezzaral
0
96
Member Avatar for DevilSolution

Okay first of all, hi people of daniweb. Im relatively new to the eclipse interface and as you have probably already guessed im using java. My question is directed towards the debugger interface, im fairly used visual studio and using "f11" to do a step by step view of what …

Member Avatar for DevilSolution
0
91
Member Avatar for asif49

I'm not able to do this after trying several times, maybe someone out there will know a way. I have several lists, each have 5 string elements inside them. I want to loop through the list and put each item on a String (if the item hasn't been added to …

Member Avatar for asif49
-1
99
Member Avatar for spades0001

Hey guys! I created a program that allows a user to display an image from a file chooser. I am trying to add a feature similar to that of the Facebook picture tagging system. When the user clicks on the image, a box with a dialogue box (where you input …

Member Avatar for StephNicolaou
0
161
Member Avatar for asif49

Basically in my switch case, I'm trying to get it so if a String is typed in I want to return a message saying "Please enter an integer". I've tried using the try { } catch { } to do this but what happens is that in some of my …

Member Avatar for gusano79
0
5K
Member Avatar for vaironl

Hello Forum, Vaironl here. I'm going to ask a question, that will most likely annoy you all, but first let me say this, I did some research but cannot use a Jscrollbar efficiently. That being said, I want to give more details. I'm trying to add a scrollbar to a …

Member Avatar for vaironl
0
119
Member Avatar for koolhawk

So Im trying to make a boggle program. It loads a text file for the word list. So my question is, How could I allow the user to specify a word and then have the program check if that word is on the game board. Heres my code so far: …

Member Avatar for NormR1
0
171
Member Avatar for lena1990

my project is that information is inserted or deleted or updated from many location but the database is in one location is this mean that database is centrilized or distrubuited

Member Avatar for StephNicolaou
0
70
Member Avatar for dineshswamy

[CODE] import java.util.*; public class PetrinetSim { public int noofplaces=0; public int nooftransitions=0; public inputarc[] ip=new inputarc[50]; public outputarc[] op=new outputarc[30]; ArrayList<place> pl= new ArrayList<place>(); public Scanner in=new Scanner(System.in); place[] p; transition[] t; void createplaces() { int i; p=new place[noofplaces]; for(i=0;i<noofplaces;i++) { p[i]=new place(); p[i].token=0; p[i].id=i; } } void createtransitions() …

Member Avatar for JamesCherrill
0
239
Member Avatar for pesalakalyan

[CODE]package pack; import java.util.*; class Filltool { Scanner s = new Scanner(System.in); String str; int r = s.nextInt(); int q = s.nextInt(); char ch[] = new char[q]; int arr[][] = new int[r][q]; void insert() { for(int i = 0; i < r; i++) { str = s.next(); ch = str.toCharArray(); …

Member Avatar for JamesCherrill
0
126
Member Avatar for rotten69

Hi everyone, I'd like to ask our Java experts a simple question about learning Java. I want to know how to learn a programming language in easy steps(if possible) especially Java. Would anyone suggest a good way of learning it and improving the way that from how a normal person …

Member Avatar for hiddepolen
0
152
Member Avatar for Syrne

Hi there! So I'm working on my next assignment and it's all about implementing a few exceptions in order to get us familiar with the topic. I am tasked with implementing 3 very simple exceptions to my previous program. So far I have 2 out of 3 working fine with …

Member Avatar for JamesCherrill
0
196
Member Avatar for SasseMan

Hi! I'm wondering if there is a tool to make the following functionality in an wasy way. I have a project in eclipse and I use perforce for versioning. I want to be able to compare the project between two dates and determine which classes/packages etc. that have been added …

0
82
Member Avatar for newprogrammer01

Hey here is the task. 1. Design a class, called People, that includes a person’s name and a weight with a constructor, 2 getter methods, and a toString() method. 2. Design a second class, called PeopleList (like the IntegerList lab or CDCollection class) that has an array of People, and …

Member Avatar for stultuske
0
247
Member Avatar for jonnyboy12

Hello all. I am trying to use java excel code that requires that i use a throwable class along with a main set up like this. [CODE] public void t()throws IOException{ GmailClient newGmailClient = new GmailClient(); newGmailClient.Main(); newGmailClient.addWindowListener ( newGmailClient ); newGmailClient.setInputFile("c:/Book12.xls"); newGmailClient.read(); } public static void main(String[] args)throws IOException …

Member Avatar for stultuske
0
111
Member Avatar for DragoDraco

Can someone please explain to me why I am getting errors with this? [CODE] /** This class stores data about a room. */ public class Room { private int walls; // Number of walls private int windows; // Number of windows private String ceiling; // Type of ceiling private String …

Member Avatar for JamesCherrill
0
123
Member Avatar for oldezwe

here is a snippet from my code, my jbutton action listener [CODE]private void jButton1_actionPerformed(ActionEvent e) { System.out.println("\njButton1_actionPerformed(ActionEvent e) called."); String username = new String(jTextuser.getText()); String password = new String(jTextpass.getText()); String passwordconfirm = new String(jTextpassconfirm.getText()); String email = new String(jTextemail.getText()); String emailconfirm= new String(jTextemailconfirm.getText()); if(username.equals("") || password.equals("") || passwordconfirm.equals("") || email.equals("") …

Member Avatar for peter_budo
0
229
Member Avatar for jprince

Hey guys, I'm making a gpa calculator and almost have it completed but can't get it to read the grades and calculate the gpa properly. Any help would be great! [CODE]import java.util.Scanner; public class StudentGPA { public static void main (String args[]){ //User inputs the number of classes he/she has …

Member Avatar for peter_budo
0
606
Member Avatar for oldezwe

I am using this code in a jbutton to open a webpage from my java application. [CODE] try { //Set your page url in this string. For eg, I m using URL for Google Search engine String url = "http://www.google.com"; java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); } catch (java.io.IOException e) { System.out.println(e.getMessage()); } [/CODE] Though, …

Member Avatar for peter_budo
0
480
Member Avatar for hadeelh30

Hi can you help me please to Write a java class which prompts the user for an hourly rate (a double). The program should then calculate the wages for a 40 hour week using a while loop to count the hours and adding the hourly rate each time to the …

Member Avatar for peter_budo
-1
44
Member Avatar for programing

the output of this program should return the number of letter in words [CODE]/** * @(#)Coun.java * * * @author * @version 1.00 2011/11/18 */ import java .util.Scanner; public class Coun { Scanner input=new Scanner(System.in); public static void main(String [] args) { System.out.println("Enter a string: "); String[] arr = input.nextInt(); …

Member Avatar for stevanity
0
138
Member Avatar for techgeek420

I'm trying to make a program that has the possibility to vote for different people. When a vote is added to a person, I want the pie chart above to change according to the votes. I have everything done except for the part of the pie chart changing. This is …

Member Avatar for EddieHappens
0
7K
Member Avatar for oldezwe

I've found really good information/tutorials online for writing from my java application to my MySQL database. Can someone direct to one on retrieving information from my database to store as variables in my application? Thanks Peace and love, oldezwe

Member Avatar for pro_learner
0
163
Member Avatar for hhheng

I imported all the required jar files into build path, and almost all other eclipse class and events, e.g. SWT, widgets, graphics, selectionevents are working. However, but when I try to create an instance of CoolBar and DateTime, found that import these 2 classes are unavailable, and importing SWT.*, SWT.widgets.* …

0
63
Member Avatar for Daigan

So I was given a code about IO to understand [CODE]// The "FileIO" class. import java.awt.*; import hsa.Console; import java.io.*; public class FileIO { static Console c; // The output console public void writeFile () { PrintWriter output; String fileName; c.println ("Saving a File in Java!"); c.print ("Enter file name: …

Member Avatar for Daigan
0
145
Member Avatar for nyfan68

I have an assignment on recursion that calls for me to use recursion to find the largest element in an array. I have a general understanding on how recursion works but this problem throws me off because I can't figure out how to correctly implement the getMaximum() function which is …

Member Avatar for NormR1
0
142
Member Avatar for Programmerman

I am trying to access a varible value from a return fuction in another class. Everytime I attempt to access the variable, it returns a null value. This is selecting from a choice control Part of the first class called CheeseBread [CODE]public void itemStateChanged(ItemEvent e) { if(e.getSource() == total1) { …

Member Avatar for NormR1
0
201

The End.