32,204 Topics
| |
Hi!! I have written three classes (two of which are most relevant) and am required to construct an operating calculator. This is the CalculatorPanel: [CODE]/* * CalculatorPanel.java * * Lab 19, COMP160, 2010 * * An alternative GUI front end for the Calculator class * */ import javax.swing.*; import java.awt.event.*; … | |
okay i've been using bluej for learning purposes but i kind of hit a snag would it be possible for someone to code me a main method so that it works as stand alone program please [code] public class Circle { private int diameter; private int xPosition; private int yPosition; … | |
Hi guys, I'm working on a program which is essentially Rock Paper Scissors Vs. the computer. Anyway I'm having a bit of difficulty with it and could use some assistance. I need to use a class method, so I decided to separate the computer's choice in the class method, I'd … | |
I believe all of my logic is sound, but syntax is off a bit... -ask for total numbers -for loop to input total numbers -1)input first number -2)throw exception "must be positive" -3)if negative > back to 1 -4)if no exception > calculate average This is my first program using … | |
Im trying to create a program which acts like a fruit machine at the moment i am writing an action listener to work with the spin JButton. i have a number of IconImages constructed. could i possibly set these images as an array and then use the random int method … | |
| |
Greetings from a new Java coder. I have ran unto a problem that i cant seem too solve on my own. And since next class is on Tuesday i hope you can help me out. When i compile this i get an error on "Line 57 : "Scan cannot be … | |
Hi, I'm working on a program with GUI and I'm having a fair amount of trouble with the following code. As you can see below, I have an application and a support class. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class StyleOptionsPanel extends JPanel { private JLabel saying; private JCheckBox … | |
Hello, I'm in a software design class and we are using java; I've taken other programming classes and I'm familiar with a few other languages but that's the problem. I feel like I'm missing the point of java. I don't even know the term for it...but the java style I … | |
Hey guys, I'm working on this program. It should roll 2 separate die and repeats until the computer rolls doubles. I'm having some issues with it and could use some help. [CODE]// RollDoubles.java // import java.util.Scanner; public class RollDoubles { // Dice roll repeatedly until computer rolls doubles // print … | |
HI guys, I would like to create a Java file based on the information from an XML file. I would like to read the info from an xml and generate a class and it's method. e.g [CODE] <person> <name>croc</name> <surname>crocky</surname> <age>12</age> </person>[/CODE] then it should generate: [CODE] public class Person … | |
Hi. I am trying to create a stand alone app but stuck somewhere. When i click on a JCheckBox, it opens up another frame window. in this window if i click cancel then the JCheckBox in the previous frame is not checked. but if i click OK then this JCheckBox … | |
Hi, I found a very useful app on the web. Downloaded the .class file and was just wondering if it would be possible to somehow put that app on my phone. It's a Nokia E5 and I'm certain it has java. Please advise. Thank you. | |
Hey Everybody I'm just confused on something for my tic tac toe game. I have to make one in a java gui and im just confused as to how i should go abouts displaying the buttons on the board. What i'm trying to say is why is it better to … | |
Hello, I have to write a program that prompts the user to enter a phone number expressed in letters and outputs the corresponding phone numbers in digits. The user can use lowercase and uppercase letters, as well as spaces between words. And I am supposed to use the charAt method … | |
im developing a language converter so i want to do like this source | target (this is only example) aa | q bb | w cc | e im using netbeans ide i have a one textfield for input strings and textarea(i used textarea becoz i dont know how to … | |
I am trying to write an algorithm that finds the Lagrange polynomial given a set of points, in quadratic time. I don't necessarily want the code to do it, just an explanation on how to write this algorithm in java in quadratic time. I know the equation, its relatively simple, … | |
Hello Everyone! First of all thanks again for viewing my thread. I was hoping someone could give me some good advice or point me to some code examples of java code calling an Ant JUnit Target if that makes sense. Basically I have a very basic java gui that upon … | |
I can't figure out what the error means that I keep getting on my loop. I have it set to only take 5 arguments, which is my limit, but I can't tell what it's saying: [code] Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 at Duplicates.EnterNumbers(Duplicates.java:20) at Duplicates.main(Duplicates.java:28) [/code] Here's my code: … | |
trouble putting together program for designing catface that will resize in the frame import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import javax.swing.JPanel; import javax.swing.JComponent; import javax.swing.JFrame; import java.util.Random; import java.awt.geom.Arc2D; import java.awt.BasicStroke; /** * A component that draws a Cat Face. *@Kevin Bennett */ public … | |
Hi friends i need ur help. i am learning asp. but now i am goin to face some java question so plz help me in solving these 4 questions. | |
Hello I am a new java student. I have a lab in which we have to compare strings to see if they are anagrams. When I compile it I'm not getting any errors but its not running as it should or as it was running the other night. I have … | |
Hi all, I'm doing sentence scoring. Let say,i have a paragraph with several sentences.Each sentence has a score(type double). Hi,I'm programming java (this sentence score:1.2) It's nice to code (this sentence score:0.3) Not so nice when having problem (this sentence score:0.8) What kind of structure should i use to ease … | |
I am in my second week of java programing and after reading the chapters I seem to be a bit lost this weeks assingment is [I]• Create a non-GUI-based Java application that calculates the payroll for a department in an organization. The application should display text that requests the user … | |
Hello everybody, This is my first time on this forum. I started this year with a study, where i learn Java. I'm from the Netherlands, so some names in the classes you may not know. I have a problem with printing out a few arrays of P in the class … | |
what is the function that allows to accept typed input usually i right import java.io.*; but eclipse has got its own function . what is it? | |
I have been working on this code for a total of 6 days, I have be trying find ways to implement the user to enter an integer 5 times then reverese those number and determine wheter this is a palindrome or not. Also not the my public static boolean isPalindrome … | |
I am currently playing about with lesson 08 here [url]http://insanitydesign.com/wp/projects/nehe-android-ports/[/url] I would like to change the background colour from black to white. In order to do this at the start of onDrawFrame() I have called [code=java] gl.glClearColor(1.0f, 0.0f, 0.0f, 0.0f); [/code] This does indeed set a white background screen, but … | |
Hi guys, I hv the two coordinates of the map. Top left : 37 44 55.49S 144 52 30.73E bottom right: 37 47 54.43S 144 57 59.54E my map is a rectangle with 500width 800height. I want to get the mouse pointer in terms of lat long in degrees and … | |
I have try to run a program of JApplet as JFrame, but it didn't works. Can someone help me?Thanks.[CODE] public class MyApplet extends JApplet{ //have some coding here class display extends JPanel{ //have some coding here } public static void main(String [] arg){ JFrame frame = new JFrame("MyApplet"); MyApplet applet … |
The End.