32,204 Topics
| |
[CODE]public void takeGuess () throws IOException { temp=" "; Hangman obj = new Hangman(); System.out.println ("Enter a character or type in 'hint' for a hint!"); DataInputStream input=new DataInputStream(System.in); temp= input.readLine(); if (temp.length()==1) { guess=temp.charAt(0); if ((guess >= 'a' && guess <='z') || (guess >='A' && guess <='Z')) {System.out.println();} else {System.out.println … | |
The question asks: Enhance the [I]addInterest[/I] method of the [I]SavingsAccount[/I] class to compute the interest on the minimum balance since the last call to [I]addInterest[/I]. [I]Hint[/I]: You need to modify the withdraw method as well, and you need to add an instance variable to remember the minimum balance. (Oh, and … | |
Here's what I got so far. I am trying to add the two fractions together while following the UML. I attached the assignment to this as well. I have no Idea how to create the add method. It's for an online class, and this one is just killing me. Thank … | |
Hi guys, im facing a real problem with a project im doing at the moment as Im new to Java. Ive set all the buttons for the program however, i need to make the pictures show randomly. also, il need to make some buttons work, like the nudge button for … | |
Hi! I'm trying to login to my website throught my program, to do that I need a password and username. The password is encrypted using C# SHA256 but on the server it uses an javascript code I got from the web. My problem is that my C# Hash differs in … | |
hello can you help me please how can i make the function array...please help me because i have no idea for this...thank you in advance hoping for your positive responds... | |
SINGLE USER CONTIGOUS SCHEME: INPUT THE SIZE OF MEMORY DISPLAY THE SIZE OF THE OS BY COMPUTING 20% OF THE MEMORY INPUT THE NUMBER OF JOBS EXAMPLE: IF THE NUMBER OF JOB IS ENTERED THE SCREEN WILL GIVE YOU AN OUTPUT LIKE THIS JOB 1; JOB 2; JOB 3; JOB … | |
I have a problem how to transfer my European CApitals Array into JLabel Array, without writing the capitals on each JLabel. I figured out my dropdown menues, but I want to display the counties on JLabels and parallel to it, the textboxes for the capitals, with the JButon next to … | |
Hi! I would like to create textfields that will serve for sorting data in JTable, and the width of these textfields will correspond to a column width. So, below you may see the code that worked until I did not use an array of textfields. Now, the size of [ICODE]txtRegNum[/ICODE] … | |
We have this script that makes the photo change when you mouseover different items on the list. How can we make the photo link change as well? For example, how can we make the photo link to Yahoo when we hover over item 1 but to Google when we hover … | |
Can somebody help me change the rectangle to an oval? I try importing the Ellipse but it doesnt work :( [ICODE]import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.TexturePaint; import java.awt.geom.*; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import javax.swing.JFrame; import javax.swing.JPanel; import com.sun.image.codec.jpeg.ImageFormatException; import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGImageDecoder; … | |
Hi all! I have moved on to learning about classes.....they don't seem as bad as the past things I have done so far. I have, however, hit a few snags along the way. Here is my code for my Rectangle class [code] public class Rectangle { private int x; private … | |
Please help I am brand new to java I need help creating the java code so that when I click a button it will add .01 to a running total. I have tried to modify a calculator code but it did not work. Any help at all. Thank you | |
I'm writing Solitaire in java and have each column of cards set up as a 2d arraylist of JLabels, one label hads the icon and is painted to a jpanel. The other contains the url for the image as the text of the label. Below is part of the code … | |
Hi there, I'm working on a 'queue program' which will queue 30 job numbers(case 1) between 1 and 30, validated, in an array, display the array , (case 3) and remove a number from the back of the queue.(case 2) I have the display array and remove from front of … | |
Hey guys. I have a headache here as im new to Java. Ive tried searching, but found nothing that really helped me out. forgive a noob :) Im trying to split a string from a textfile with the following format: 0 0 0 0 0 0 0 0 0 110 … | |
this is inside my servlet: [CODE]ArrayList<String> currentCustomer = model.getAllCustomers(); req.setAttribute("currentCustomer", currentCustomer );[/CODE] how do i access this arraylist in my JSP file? I eventually wanna loop over each string element. | |
Just I am confused to choose which type of programming language for project development.... | |
Hi I wanted to know how to do this: - when the user clicks on a index in listbox from classA - the value of that index(written in classB) will go into the textbox from classC I have already written the coding for classA I just need help writting the … | |
[ICODE][/ICODE]Hi, I am trying to figure out how to start my next Inventory program part 4. What I wish to know is 1. Do I choose a New Project or choose New File? What I have been doing so far is choosing New Project. All the programs are extending from … | |
Hello, I basically have 2 GUI windows in my project. Just to explain it better, let's call the 2 GUI windows: - Window A - Window B In Window A, there is a variable that I want to change, but I have to change the value of the variable in … | |
Hi all! I am extremely new to java and to computer programming in general so I greatly appreciate all our help. Here's my problem, I am trying to write a program that reads in a basic text file with some names and some numbers, and inputs the given information into … | |
Is there a way by which I can examine how the class Class was coded? | |
[CODE]import javax.swing.*; import java.awt.*; class Calculator{ JFrame frame; JPanel panel1, panel2; JTextField textField; JButton button[]; Container contentPane; void launchFrame(){ frame = new JFrame("My Calculator"); panel1 = new JPanel(); panel2 = new JPanel(new GridLayout(4,4)); textField = new JTextField(10); button = new JButton[17]; for (int i=0; i <10; i++) button[i] = new … | |
Hello. It's been a while since I was on here. I'm writing a Java class with a generic type parameter. Among other things, it maintains an internal ArrayList of the same generic type as itself. In a perfect world, the code would go like this: [CODE=Java]import java.util.ArrayList; public class MyGenericClass<T> … | |
Hi everybody, I am planning to build a java programe named word counter. It shall have file view and help menu. A text field where user can type or paste text. A button which starts counting number of words in the text. and a text field where the total number … | |
I'm trying to improve one of my project by adding texture to a shape. The shape is oval, it basically the moon. I want it to have a realistic feel rather than gradient fill. So I look up some tutorial and this is what i got from [url]http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Graphics.doc.html[/url] [ICODE] // … | |
[code]public double bigramPMI(String bigram,String []bi) { String[] arr = bigram.split(" "); int n11 = 0, n12 = 0, n21 = 0, n22 = 0, n1p = 0, np1 = 0, n2p = 0, np2 = 0, npp = 0; double m11 = 0, PMI = 0; for (int i = … | |
I have been trying to remove two errors in this code, line 12 (non-static variable this cannot be referenced from a static context) and line 204(cannot find symbol:(method `compareTo(java.lang.Object)` import java.util.*; public class InventoryPart3 { public static void main(String[] args) { Inventory invent = new Inventory(); <---[U]non-static variable this cannot … | |
i am having this problem , i have 8 strings say ( boy,topped,pens,remotes ,boted ,toyed, car,house) but i am looking for 3 strings having substrings ending with a (ed,s,s ) for exapmle topp[COLOR="Red"]ed[/COLOR],pen[COLOR="Red"]s[/COLOR],remote[COLOR="Red"]s[/COLOR] however i have to check by first checking the first string boy and i throw it away … |
The End.