32,204 Topics
| |
I am a first time user to Java and I am stuck and cant figure out what to do.. Please help. My code is [code] import java.util.Scanner; public class rshomework2 { public static void main ( String[] args) { Scanner input = new Scanner(System.in); sales; final double base = 800; … | |
Hello forum, Vaironl here. I have to do an assignment for school and I was about 3 hours designing the prototype and everything was going right but I had to add arrays and a for loop to my system and after that everything just got ugly. Therefore I started from … | |
I wrote a bit of code at school using a copy of Net Beans that they have installed on the computers in the lab at my school. I saved my file to my thumb drive as Lab2.Java. When I got home I opened my copy of Net Beans 7.0.1 and … | |
Hi, I haven't seriously written Java code in over 5 years. I am looking to find good online resources to help me refresh in a few weeks. Thanks! Marquita | |
alright iam working on this code and it is driving me nuts someone please help me alright here is my code :[CODE]import java.util.Scanner; public class TestScoreApp { public static void main(String[] args) { // display operational messages System.out.println("Please enter test scores that range from 0 to 100."); System.out.println("To end the … | |
I have to write a code that will print out the sum of all numbers between 1 and 100 that 7 and 5 go into evenly. I can't really think of how to write it. This is what I have but it doesn't work.[CODE] import java.io.*; public class work {public … | |
Yes, I've already checked the pinned thread, all of the suggested books there are for Core java Kindly post good books for J2EE thanks :) | |
Hi all, I am having trouble with class communication to reset some textfields through event handling. Any help would be appreciated. Here is a portion of my code. [B]The class that contains the textfields that I wish to use a reset button for:[/B] [CODE]import java.awt.*; import javax.swing.*; import javax.swing.border.*; public … | |
Hello..! I am newbie to java and I have got frustrated using notepad, can anyone please suggest me a good compiler for java. I am using Windows 7 as O.S. | |
Hello. I recently started studying Java and OOP. I am currently creating a class that writes text to a file in a particular format. I have 'finished' it, and it works, but I am unsure as to the quality of the implementation. This is how it works: * First of … | |
I have a two-d array from which I need to read values from any and all sides of each index. for example [CODE]int x=0, y=0; myArray [x - 1][y - 1];[/CODE] where x-1 and y-1 would be the values of the other end of the array. I've been up over … | |
A quantity known as the body mass index (BMI) is used to calculate the risk of weight-related health problems. BMI is computed by the formula BMI = w/(h/100)^2 Where w is weight in kilograms and h is height in centimeters. A BMI of about 20 to 25 is considered “normal.” … | |
I am having an error with my constructor, why is that? :| [CODE]public class Name{ private String firstName; private String middleName; private String lastName; public Name(){ this( "null" , "null" , "null"); } public Name(String first){ this(first," "," "); } public Name(String middle){ this(" ",middle," "); } public Name(String fName … | |
Im having problems with my code. :( the code should. the submenu for my menu should be on a radio button type. here's my first code: [CODE] public ... { //for background JMenuItem image = new JMenuItem("Images"); JMenuItem music = new JMenuItem("Music"); //submenu of music JRadioButtonMenuItem play = new JRadioButtonMenuItem("Play"); … | |
[CODE]/** * @(#)Car.java * *Chp.3 3.5 * @author Alec Ziff * @version 1.00 2011/9/23 */ public class Car { { public Car(double fuelEffciency) //all values are in miles per gallon { efficiency= fuelEfficiency; } public void addGas(double gas) { double newFuel= fuel + gas; fuel= newFuel; } public double drive( … | |
[CODE]public class CarTester { public static void main (String[] args) { Car myMysteryMachine = new Car (1000); // Car gets 1000 miles per gallon myMysteryMachine.addGas(20); // 20 gallons of gas are added to the tank myMysteryMachine.drive(100); // Driving the car 100 miles System.out.println(myMysteryMachine.getGasInTank()); // Method prints the remaining fuel } … | |
want to print Jframe like our word document. I have one jframe on jframe i have Jpanel ond on that panel i have j label . In jlabel i written a letter i want to print that letter so how can I print that letter. thank you | |
DiceRoller.java You are to write a program which will ask the user for the number and type of dice they would like to roll in the form of “xdy”. The x represents the number of dice, and the y represents how many sides the dice have. Your program MUST read … | |
Ok, I have this project In which I have to Write a Java program that can simulate a truck delivery, using the Java console as the exclusive input and output device. That is, each input to the TruckItem class, either unload or load an item (meaning creation of an object … | |
hey there, I am trying to build a small around soccer/football matches. So, I have built a class that models a Match (Match.java). It only contains field variables like hostid, guestid, matchid, result, and such, and setter and getter methods. When I retrieve matches from my sqlite database, I build … | |
I got a homework, its due by monday. I have read textbook a lot but i still dont know what to do next steps. Here is problem. The program should prompt the user for and accept two inputs: 1. The total price (including any applicable tax, etc.) for whatever was … | |
Dear friends , I am new to java . I created an JFrame(Calculator) application in Netbeans.Now i want to run that file from console(putty) since i gonna use that .java class in some other program through which i want invoke this . How do i do this . When i … | |
Problem 2. Create a new java file called Barcode.java that will check to see if a given barcode number is valid. Barcodes have a 12 digit number on them that is used to determine the validity of the code. This is done by summing the odd position digits (1,3,5,7,9 and … | |
guys, good day! I just want to ask how to reload/refresh a JComboBox. I have a cardlayout with 3 panels, each panel has its own combobox. what I want to do is to reload the combobox to its original state each time I swap the cardlayout. updateUI(); repaint(); revalidate(); I … | |
So I am trying to load a .png file for a very simple game. I have my all of my code saved in the directory: "C:\Users\Zach\Desktop\TestGame\source", and my image that I'm trying to load in a directory called "C:\Users\Zach\Desktop\TestGame\images". To load the image i am using [CODE]ImageIcon ii = new … | |
I have pretty much gotten my program to run with one little exception. It is asking for the SKU number which has been set but when I run the program it assigns a number to item and does not give me the sku number I had entered in the program. … | |
I'm searching for a good tutorial about object oriented analysis and design but can't find any short and clear tutorial which will has: 1. Explanation of oo concepts (very short) 2. CODE EXAMPLE (eg. if someone describe aggregation I wanna see how I can use this in my class) There … | |
I am just learning Java and am trying to use variables from objects that I passed into another method. Can someone help me here [CODE] package data; public class Data { private int day, month, year; public Data(int day, int month, int year) { this.day = day; this.month = month; … | |
Hey guys! I've created a simple program that given the current day and how many days from the current day, it will determine if it's a Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, where 1 Sun, 2 -Mon, 3-Tues, 4 -Wed, 5 -Thurs, 6 -Fri, 7-Sat My problem is that … | |
I had a problem.. when I call a frame which is a GUI and push a button which will be disabled.. and my problem was how should it retain the disabled button if the GUI was called again.. please help.. can you give an example.. |
The End.