35,618 Topics
![]() | |
Hi I am trying to make a program that prints a snooker board on the screen. I am trying to print the different parts on top of each other. So far all I am able to do is print the background. when i try to print the cloth on top … | |
Hi Folks! I got to game (know as concentration or memory)code for my assignment. I have found many similar tasks, but mine is a bit different. Our teacher asked us to implement comboBox that we could switch between images and text version. So far I have made image one, and … | |
Looking for Java help! I am working on the payroll program below and would like some help please. When I run the prograom, I am using jGrasp, the program runs with no errors identified in the code but I get the following window that pops up...."No main methods, applets, or … ![]() | |
how to get only the file name from the given path............ [B]example1:[/B] String str1="C:\New Folder\My Data\kk.png" From the above how can we get only the file [B]kk.png[/B] [B]example2: [/B] String str1="C:\New Folder\My Data\Java\Project\yy.bmp" From the above how can we get only the file [B]yy.bmp[/B] | |
i am using an array of JButtons b[23].... my objective is that when i click a button it has to change its background color to black but it is giving a nullpointer exception.... if(ae.getActionCommand().equals("0")) { System.out.println("button b[o] is pressed"); b[0].setBackground(Color.black); } } can anyone help me with this please........ ![]() | |
Write the definition of a class student. Student object should represent student in a school. it should contain the following information: id,name,age,address. Can someone tellme the definition using this example?? am still a newbie in java. | |
![]() | Hello again everyone, on my recent thread about my rock, paper, scissors program, I had trouble running it from Applet to JApplet and that problem was solved. So far, I've added many functions for the program such as menus, checking your score, resetting the score, and setting the number of … |
[CODE]//Program to find the sum of the main and right diagonals of a 2D array import java.io.*; public class Diagonals { public static void main(String[]args)throws IOException { int arr[][]={{1,2,3,4},{1,2,3,4},{1,2,3,4},{1,2,3,4}}; int maindiag=0;int rightdiag=0; for(int i=0;i<4;i++) { for(int j=0;j<4;j++) { if(i==j) { maindiag=maindiag+arr[i][j]; } } } System.out.println("The sum of the main diagonal … | |
Hello I need to figure this out, I tried if ((Fire = 0) || (Water = 0) || (Air = 0) || (Earth = 0)) { System.out.println("Hello"); } But the compiler says I cant use && for ints, I need to get a value for each variable and have certain … | |
Hi, Below line of code in my program is priting Date & Time in the format [B]11/3/11 4:33:13 PM IST[/B] , how can i print only the lines which are between spcific dates by using the above printed date format in JAVA. System.out.println("Date & time: " + akarray.getModifiedTime()); | |
Hello! I have size about 200*250 icon for my simple application. I need to put it inside on frame as (about) 40*40 size. But when i try everything (image icon, icon for JLabel...) but i could not re-size it inside on JFreme. I f i set the size as 40*40, … | |
I cant figure out how to fix the "public class Triangle implements Measurable" i dont know what i am doing wrong to get this error.. i am not fluent in java but i never had this error before. i tried changing the name but in the process i get more … | |
Okay, so I did this not too long ago but I forgot the exact the procedure. Now, I think I was doing it all right after I set it up for Web Start, but when I went to Clean and Build to generate the files needed for online, I got … | |
hey i am currently working with java to do assignment. i dont know how to call form from menubar to open new form,,, so anyone can help...... | |
Just want to be clear, this is practice, not homework. I'm attempting to understand this a bit better...but I'm a bit lost as what to use for my test...and what exactly will help me get to the base case. Here is what I have so far [CODE] public class int … | |
Hello I need help with a program I want to make a method that takes a String and uses the text in that String to use a method from an object. Something like this: public void doThat(String text) { myObject.text();// Where text is the actual text stored in the String … | |
So I'm trying to create a program that will take values from one array and multiply them with the values in the second array and then allocate the answer into a third array, then returning that array as a result [code]import java.util.Arrays; public class ArrayCreator { public static void main( … | |
'ellos So I'm making a Hangman game, and for the sake of completeness I want to have a HELP feature. When the Help button is clicked, a browser window should open up (not *within* the game frame... but just generally) and display the HTML Help file. How do I do … | |
hello all using ComboBox has it own backward,if the Item are too much ,then the combobox will become very tall (when it call) the other way is using textfield.Which will show selection ,only the items which have the same fist item's Letter with the one we type in. The question … | |
i have to create a DigitsDisplay application that prompts the user for a non negative integer and then displays each digit on a separate line like such "Enter a positive integer: 789 7 8 9 this is what i have so far Can someone please help me fix this program … | |
below is my current code for a math game i'm having problems creating the answer checking part of it, any assistance is appreciated. [code] import javax.swing.*; import java.util.Random; import java.awt.Button; import java.awt.Color; import java.awt.Dimension; import java.awt.Event; import java.awt.event.*; import javax.swing.*; public class MathPanel extends JPanel { // Declares Labels and … | |
For some reason the file that I input into my GUI isn't being found by Java even though windows explorer finds it just fine. If you'd like to see a specific part of the code, just ask! Thanks in advance, Jack | |
Originally I had the program all in main but I wanted to separate this by having the comparison method (diamond of asterisks) in its own method. For some odd reason I'm getting weird errors that won't allow the program to run. Errors below: 1) Systan error on token "," delete … | |
![]() | My question is ; how to take a value from a loop and continue the loop and take the new value again, print it and add it to the old one? thanks [CODE] while (numCourses <= 3) // loop 1 times { System.out.print( "Enter grade (one character): " ); // … |
I'm new to Java (2 weeks) and was given a class assignment to create a program that takes a 5 digit number and checks to see if it is a palindrome (same forwards as backwards.) The requirement stated to use the methods main(), retrieveInput(), check(), and display(). My code works … ![]() | |
Hey, I am having trouble compiling in netbeans. When I go to compile, I usually go to Run>Clean and Build Main Project (or shift F11). When it compilies, it says Copying 1 file to /Users/me/NetBeansProjects/JavaApplication11/build Nothing to copy. And when I go to run the .jar file, it doesn't open … | |
I am working on packet analyzing software, so i just need a kick to start by reading the packets of wireless, but i dont have any idea regarding to it... Any who handled such kinds of projects before please help me a bit.... | |
basically i have a online game underway all php based what i am trying to do is create a client which the user can download and basically run the game from there desktop. the site runs mysql latest version. but what i really want to know how to do is … | |
I am new to JSP and I am not very familiar with what its advantages and disadvantages are. We all know that Java is a big and complicated language, but it's not as web oriented as PHP. I have also heard that it's more expensive to find a server for … | |
I have a java code that i don't know what is the problem. could you help me? On"Stock testStock = new Stock();" I get an error message that says " Stockcannot be resolved to a type." import java.util.Scanner; /** An application class to test Stock class */ public class StockTesting … |
The End.