35,618 Topics

Member Avatar for
Member Avatar for thanatos1

Hey guys, i'll try to give you a brief background, then my question. I've been trying to write a copy of a pokemon game that came out in the 90's (blue/red) and i've come across a couple issues when it comes to how to deal with events and how to …

0
78
Member Avatar for junsugal

Hi, I wanted to know the big Oh notation for this operation in Dynamic Array and LinkedList. I have answered the question but I am not sure if I really know how to determine the complexity. Please give me feedback of what I've done. Operation: Construct empty list : DA->O(1) …

0
101
Member Avatar for salsashark

I am trying to do a simple chat client for the Android (running 2.3.3 on an emulator on my computer and programing in eclipse. Below is a copy of my client code which is working fine as a normal java app. Below that I have what I have been working …

Member Avatar for mustafaneguib
0
388
Member Avatar for abyss776

I've been searching the internet for a way to specify the size of a component within a JPanel, but I haven't been able to find anything that has worked. The best answer I came across was to override the getPreferredSize(), getMaximumSize(), and getMinimumSize() methods of the component, but the component …

Member Avatar for abyss776
0
213
Member Avatar for ibthevivin

My issue is with the "if" statement. Basically I want the program to have proper grammar when it states, "1 [COLOR="red"]hour[/COLOR], 1 [COLOR="red"]minute[/COLOR], 1 [COLOR="red"]second[/COLOR]", instead of "1 [COLOR="red"]hours[/COLOR], 1 [COLOR="red"]minutes[/COLOR], 1 [COLOR="red"]seconds[/COLOR]". See what I mean? I gave it a go with "hours" but with no success. Plus any …

Member Avatar for hfx642
0
183
Member Avatar for jmercer23

I keep getting this error code on the code I wrote up for the array assignment in pgr. C:\Users\niffer\Desktop\weekfour.java:49: error: reached end of file while parsing } ^ 1 error Tool completed with exit code 1 I have looked over the code and can not see where the brackets are …

Member Avatar for NormR1
0
368
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
136
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
677
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
203
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
97
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
93
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
100
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
163
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
6K
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
120
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
172
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
71
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
247
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
127
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
153
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
197
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
249
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
112
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
124
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
230
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
607
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
482
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
45
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
140

The End.