32,199 Topics
| |
ok so i need my code to be able to have the balls on the screen detect collision and remove a ball when they collide but for some reason every time i hit the add a ball button they disappear on me. and they dont detect collision in the first … | |
I'm having problems using my AudioPlayer class. I have a class that calls it which simply contains the following: [CODE=java]public class Test { public void test() { AudioPlayer ap1 = new AudioPlayer(); ap1.printUsageAndExit(); ap1.main({"a.wav"}); } }[/CODE] I recieve the error on line 6, when I call [CODE=java]ap1.main({"a.wav"});[/CODE] Note: When I … | |
[CODE] import java.util.*; class Painting { private String title; private String name; int value; public Painting(){} public Painting(String t,String n) { title = t; name = n; } public void setValue(int v) { value = v; } public void setPrice() { value = 400; } public String getTitle() { return … | |
Hi. I have a constructor like below whose class extends JFrame. The problem is that my for loop is printing only the last string.( I am using this information ultimately to build a JButton table). Can somebody tell me whats wrong with this ? Below is the code:- [CODE] public … | |
Hi, I am currently developing a cafe ordering and payment system which i encounter some calculation issue... i need a formula which is able to calculate the total price in this scenario, If Customer A order 5 items of different prices and Customer B order 9 items of different price, … | |
I'd appreciate if somebody could have a look at this code and tell me where the problem is. The program is meant to take a .txt file and split it in three different files: one with words of 1 to 4 letters, one with words of 5 to 7 and … | |
function validate1(){ if(document.all.doc1.value == ""){ alert('Please select 1st Docoment !!'); document.all.doc1.focus(); document.all.doc2.value = ""; } var doc1 = eval(document.all.doc1.value); var doc2 = eval(document.all.doc2.value); if(doc2 < doc1){ alert('First Document number must greater than secondnd Document number!!'); document.all.doc1.focus(); document.all.doc2.value = ""; } the script above used to compare string between combo box … | |
I need to copy a file to my machine from a remote machine. Are there any ant targets to do that? | |
Hi all! Just a brief question. How would i go about adding say the first 5 numbers in an array of 12 preset values? Thanks :) | |
I have two files of huge data contains string and integers and i want to read from it and use it to count characters of the string for example name ending with letter "A" containing "oo" or having letter "A" as seconf letter. i need some methods from the String … | |
hello friends i m working on a project wherein we have to capture a photo using web cam for the web application.. can anybody tell me how we can do this. i have read many artical and found a code for the stand alone appli. from "http://www.mutong.com/fischer/java/usbcam/" but it is … | |
So, I have to write a public static method add, which takes a parameter, and adds up all the values in the N-ary tree it represents. Characterize the traversal order: preorder. - what does that mean???? So, can someone explain to me how I would do this??? thanks. | |
i want to send sms from my java application to mobiles and also email from my java application | |
I have a problem with the dispose method. . .I got 3 java files with a class name: MainProgram.java MainPanel.java PageOne.java The MainProgram java extends JFrame. The MainPanel.java extends JPanel. The PageOne.java extends JFrame. The MainPanel.java is where all the actions and etc. are being set. The MainProgram.java calls the … | |
For example I ask the user to enter a 4 digits integer number. For example the user enter 4875. I want to display odd digits (7 5) and even digits (4 8). By Extract each digit of the number using integer division and store the results in separate variables. for … | |
OK I'm making a script and I get this error and have no clue off have to fix heres the code all help is thanked: [CODE]import java.awt.*; import java.util.*; import java.util.List; import java.util.logging.Level; import javax.accessibility.*; import javax.swing.*; import org.rsbot.bot.Bot; import org.rsbot.script.*; import org.rsbot.script.wrappers.*; import org.rsbot.accessors.*; import org.rsbot.event.listeners.PaintListener; import org.rsbot.event.listeners.ServerMessageListener; import … | |
Java Code I don't know how to show odd or even digits from an integer number. For example I ask the user to enter a 4 digits integer number. For example the user enter 4875. I want to display odd digits (7 5) and even digits (4 8). By Extract … | |
hi, i want to do a web downloader, but i don't know where i should begin from? Could you help me, please? | |
Hi everyone. how to check precise UML activity diagram in java need solution asap | |
import java.io.*; import javax.swing.*; class GS { static public void main(String[]args) throws Exception{ double q, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, x, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, quotient, quotient1, quotient2, quotient3, quotient4, quotient5, sum, sum1, sum3; System.out.println("PRELIM LEC"); { … | |
Hey everyone. I am supposed to create a program that will input the miles driven and gallons used for each tank full of gas. program has to calculate and display the miler per gallon obtained for each tankful and print the combined miles per gallon for all tank fulls up … | |
| This code snippet allows you to know whether a word/sentence you have entered is a 'Magic Word' or not. A 'Magic Word' is a word which has at any position two consecutive letters. This can be achieved by taking the ASCII values of the characters. For example, if I enter … |
can u help me how to connect to MS Access database using java codes?? import java.applet.Applet; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.lang.StringBuffer; import java.io.IOException; import java.io.*; import java.sql.*; public class sample1 extends JFrame { private DataPanel myDataPanel; private Connection dbconn; private static int numPeople=0; private static String info; … | |
[code] import java.util.*; public class course { static Scanner sc=new Scanner(System.in); public static void main(String[]args) { String name,students,addStudent; int numberOfStudents; String courseName,getName,getStudents; int getnumberOfStudents; Course course1=new Course("C++"); Course course2=new Course("Java"); course1.addStudent("Peter"); course1.addStudent("Brian"); course1.addStudent("Anne"); course2.addStudent("Peter"); course1.addStudent("Steve"); System.out.println("Num of student in course1:"+course1.getnumberOfStudents()); String[]students=course1.getStudents(); for (int i = 0; i < course1.getNumberOfStudents(); i++) … | |
[code] this is the simple program that i write import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JFrame; import java.awt.FlowLayout; public class ShowFlowLayout extends JFrame { public ShowFlowLayout() { setLayout(new FlowLayout(FlowLayout.LEFT,10,20)); add(new JLabel("firstname")); add(new JTextField(10)); add(new JLabel("MI")); add(new JTextField(10)); add(new JLabel("Lastname")); } public static void main(String[] args) { JFrame frame=new JFrame("ShowFlowLayout"); frame.setSize(400,500); frame.setLocationRelativeTo(null); … | |
can anybody tel me what are the steps in capturing images from a webcam using java | |
Hi all, I'm new here, and am currently taking an introductory programming course taught with Java 5. I really hate to come here, and bother people with my homework, but I really don't have anywhere else to turn at the moment. I have a couple of quick questions about some … | |
Hi.. I am trying to load a text file into JTable. The file is tab delimited. I want to achieve the following things:- 1) Show the first line of headers on the left hand side. 2) Show my buttons on the right hand side of the JTable. The problem is … | |
import java.util.Scanner; public class BookRentalSystem { public static void main(String args[]) { //Declaration of variable and instances String bTitle, bType, bAuthor, bISBN, bStatus, search; int choice = 1; int bCount = 0; boolean found; Scanner input = new Scanner(System.in); Book[] books = new Book[5]; //Executing user's selection from menu. Exit … | |
I must be overlooking something simple here, but I have no clue why it says that it is going out of bounds. Here is my entire program... [CODE]import java.util.Scanner; import java.util.Random; public class MadLib { static Scanner input = new Scanner(System.in); static Random rng = new Random(); static String t[] … |
The End.