32,199 Topics

Member Avatar for
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
160
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
230
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
246
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
604
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
Member Avatar for cookiejarvus

I'm working on a program for class that uses the method Math.random( ) to generate random integers between 1 and 6. Then generate ten-thousand numbers between 1 and 6. Then calculate the number of 1 that has appeared, the number of 2 that has appeared, and so on. The final …

Member Avatar for teo236
0
334
Member Avatar for skracer13

Hello everyone, I'm new to Java. I found this site and the members to have a lot of knowledge and was hoping I can get some assistance. I have written this 2D array code to find the lowest value in each row and return the values. "getLowestInRow" is the method …

Member Avatar for hfx642
0
160
Member Avatar for sirlink99

I am writing code that opens notepad, but when I want to write an exclamation mark it throws an error; here is the code I am using to write the exclamation mark. [CODE] robot.keyPress(KeyEvent.VK_EXCLAMATION_MARK); robot.keyRelease(KeyEvent.VK_EXCLAMATION_MARK); [/CODE] Why is it giving me the error?

Member Avatar for JamesCherrill
0
700
Member Avatar for hadeelh30

package ch07_auxiliaryclasses.taxcalculator; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class UPAdvisor extends JFrame implements ActionListener { JButton displayadvice = new JButton("Displayadvice"); JTextField displayadviceTxt = new JTextField(11); JSpinner ucasPointSp = new JSpinner(new SpinnerNumberModel(0,0,180,10)); JRadioButton Degree = new JRadioButton("Degree", true); JRadioButton FoundationDegree = new JRadioButton("Foundation Degree", false); ButtonGroup bg = new ButtonGroup(); …

Member Avatar for NormR1
0
136
Member Avatar for justmelloyellow

I need to ask the user for 3 dates (mm/dd/yyyy) and then it needs to print the earliest, latest and the average year. I am TERRIBLE at this & am taking the class because I have to. I don't know how to compare dates any other way than how you …

Member Avatar for stultuske
0
221

The End.