35,618 Topics
![]() | |
My problem is that the image is not showing on my java. here is my code MyGame.java [CODE]package mygame; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MyGame extends JFrame { Container c; Player p; MyGame() { this.setTitle("My Game"); this.setSize(600, 400); this.setLocation(100, 100); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); c = this.getContentPane(); p = new … | |
Is anybody familiar with using ObjectEditor in Eclipse? I am working on a program and I need serious help. | |
So I need help on how to calculate how much change to give back to a customer. I need the program to give change in the least bills and coins as possible. Ex. Customer's item costs $13.37. He/She pays $20. Program gives back: One $5 Bill One $1 Bill Two … | |
Hello! I have a swing app with lots of components and stuff. I want to place a Container/Jpanel on top of everyting else that is invisible that contains other component which are visible. I can make the panel invisible or not opaque and still show its child component but I … | |
Hey guys basically I'm studying programming using the 'BlueJ' Java program on windows. I'm trying to create a 'Dynamic Billboard' program that asks a user to enter a 5 letter word than the characters are displayed on a billboard, the program uses a text file imported for the charcters). Ive … | |
I'm having trouble debugging one of my methods. The class Student inherits a class called Person and the methods are called in the main program, TestStudent. I'm trying to create a method that lets the user sort an array of grade averages in ascending order but whenever I try, I … | |
i 've got a steganography project in java.......in that we can hide text within pictures and videos......but the major disadvantage is that the hidden data is been destroyed when the image or the video is further modifies with the hidden data............is it possible to do a steganography project in java … | |
Hopefully someone can help me...I'm a student taking my first Java class. We are working on classes (building them). For this assignment the teacher gave us a test program that we have to build a class for to computer some basical mortgage calculations. Below is the class I built that … | |
Hi all, For my java class I need to make the game of life. So far I have 2 main classes that drive the program (ignoring GUI class for now.) My main classes: Cell(x, y) - where x = the x coordinate and y = the y coordinate of the … | |
![]() | Hello I'm having major issues, please help me with this code; (Generating random characters) Use the methods in RandomCharacter to print one hundred uppercase letters and then one hundred single digits, and print ten per line. Use these methods: public static char getRandomUppercaseLetter(){ return getRandomCharacter('A', 'Z'); } public static char … ![]() |
I'm having trouble sorting names in alphabetical order using counting sort, forinstance Gregory John, Alex Smith, Adam Richard, Alex Ryan Output hould be in this order Adam Richard Alex Ryan Alex Smith Gregory John My code so far [code] import java.util.ArrayList; import java.util.Scanner; public class Names { //private static int[] … | |
I have had a working jsp web applicationg for the last 2 months. All of a sudden, the application was not allowing users to log into it. After monitoring the logs upon a manual restart of glassfish, I saw the log output below: [CODE][#|2011-06-25T15:58:55.376+0300|WARNING|glassfish3.0.1||_ThreadID=26;_ThreadName=Thread-1;|Error sending syslog packet java.net.SocketException: Too many … | |
hi all, I am accessing the database by MVC model now i need to create list box , list options already in database .What should I do should i connect database with jsp directly or any option available. Thanks | |
Hi.. I have downloaded a code to add JRadioBuotton to JTable, modified it.Please see the code..What i wanted was to have blank cell...i was getting a NullPointerException for this so i tried adding a JTextBox for instead. When I click on only radiobuttons the code works fine.. if i click … | |
[CODE]public GuiPrototypeScreen1() { GuiPrototypeScreen1Layout customLayout = new GuiPrototypeScreen1Layout(); Object[] possibleValues = { "Search", "Contribute" }; Object selectedValue = JOptionPane.showInputDialog(null, "Do you want to ", "Welcome", JOptionPane.INFORMATION_MESSAGE, null, possibleValues, possibleValues[0]);[/CODE] Hey guys i need help because i am completly stuck. All i want is when a string is selected to redirect … | |
Hello, I'm not able to access jar files from servlet. Although I have imported all the class file and made the jar file available in build path. [CODE] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); cmd = request.getParameter("cmd"); System.out.println(cmd); String output = runCommand(cmd); … | |
The output is obtained from a JPasswordField and placed into a text. But whenever I enter a new input on the field, it just shows the recent one I've entered... Ex: I enter "test1" as a password. When I enter a new one, say "test2", it only shows "test2" in … | |
hay this is samar here actually i have to get values from tha my sql foe a perticular string which i pass through a xt box i think i'm not able to pass the vehicle no. to the querry this is my cade pls help [code]package p2c; import java.awt.Container; import … | |
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.” … |
The End.