32,204 Topics

Member Avatar for
Member Avatar for zmstevens

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; …

Member Avatar for Zaad
0
358
Member Avatar for vaironl

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 …

Member Avatar for vaironl
0
3K
Member Avatar for 918_Nix

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 …

Member Avatar for 918_Nix
0
270
Member Avatar for msPriesterM

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

Member Avatar for NormR1
0
147
Member Avatar for moparman426

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 …

Member Avatar for hfx642
0
158
Member Avatar for isebas

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 …

Member Avatar for hfx642
0
183
Member Avatar for chiiqui

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 :)

Member Avatar for Ezzaral
0
125
Member Avatar for javaNooblet

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 …

Member Avatar for mKorbel
0
213
Member Avatar for cse.avinash

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.

Member Avatar for hszforu
0
108
Member Avatar for G_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 …

Member Avatar for ~s.o.s~
0
210
Member Avatar for ferretfool0x77

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 …

Member Avatar for Taywin
0
1K
Member Avatar for jcooler

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.” …

Member Avatar for chiiqui
0
210
Member Avatar for chiiqui

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 …

Member Avatar for chiiqui
0
230
Member Avatar for LittleMissChoco

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"); …

Member Avatar for LittleMissChoco
0
146
Member Avatar for TigerTeck

[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( …

Member Avatar for NormR1
0
403
Member Avatar for TigerTeck

[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 } …

Member Avatar for NormR1
0
349
Member Avatar for Pravinrasal

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

Member Avatar for JamesCherrill
0
274
Member Avatar for xcrunner23

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 …

Member Avatar for NormR1
0
460
Member Avatar for ninjaConfused

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 …

Member Avatar for NormR1
0
280
Member Avatar for bibiki

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 …

Member Avatar for bibiki
0
670
Member Avatar for suioius

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 …

Member Avatar for CoolPrizes
0
153
Member Avatar for Kamal_Java

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 …

Member Avatar for peter_budo
0
252
Member Avatar for wangfz

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 …

Member Avatar for wangfz
0
113
Member Avatar for jet101

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 …

Member Avatar for jet101
0
731
Member Avatar for zachf632

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 …

Member Avatar for NormR1
0
88
Member Avatar for blondielox

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. …

Member Avatar for NormR1
0
116
Member Avatar for t2r

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 …

Member Avatar for t2r
0
180
Member Avatar for Dexxta27

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; …

Member Avatar for Dexxta27
0
171
Member Avatar for laguardian

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 …

Member Avatar for Majestics
0
346
Member Avatar for kiko11

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..

Member Avatar for harinath_2007
0
78

The End.