32,204 Topics
| |
Hi, Im trying to write a program that uses a .txt file to fill an arrayList of type Customer (A class that I made.) and then using that ArrayList to perform other functions within my Customer Database class. when I test my method, nothing is being added to the ArrayList … | |
I have written a code which used to send data that was saved in my mysql database, through ethernet using UDP protocol, everything worked fine until i sent fewer data(25 rows), when i started sending data in huge amount(100 rows) it used to display Java Result: -1073740791 and would stop … | |
i want to set a collision on my tile map using getBounds function. level class int map[][] = { {2, 0, 0} {1, 1, 0} }; 2 = player 1 = ground 0 = sky i want to set collision so player cant go though ground. so he should fall … | |
In my Advanced Data Structures class we have an assignment to implement a linked list using arrays. One array holds the data item, while another contains a reference to the next item. I'm not really sure about how to add/remove items. // **************************************************** // Reference-based implementation of ADT list using … | |
Hi there everyone, I am having some difficulties getting a regular expression to work. I have a line of text with 5 numbers.I want to ignore the first number, and grab the other 4 numbers. Here is what the text I am dealing with looks like. 1681 12.33754513 7.066246057 6.079261254 … | |
In main method which should I use? CarOwner owner = new CarOwner("Danni", "123456789"); or CarOwner owner = new CarOwner(); owner.setName("Danni"); owner.setPhoneNumber("123456789"); I know how to make both work, I can edit the class file to suit whichever way it is written in the main method. But what do people do … | |
program for moving a car or object using button(start and stop) in applet and thread function | |
| Hey everyone, I am having trouble on this one practice problem. It is a question that requires another question I already completed to solve this one. The qusetion is "Implement a method allPerfect() that takes an integer parameter end. The method prints every perfect number from 1 to end. Use … |
I wanted to verify is this a good example of a flyweight design pattern: package com.flyweight; public interface Chemical { String getName(); String getSymbol(); Double getAtomicWeight(); } package com.flyweight; import java.util.HashMap; import java.util.Map; public class ChemicalFactory { private static Map chemicals = new HashMap(); private static ChemicalFactory factory = new … | |
public class Jacobi{ // jacobi(a,n) public static void main(String[] args) { int n = 234567,a = 97770; if(n<=0 || (n %2) == 0) return (0); int temp, j=1; if(a<0) { a = -a; if((n % 4) == 3) j = -j; } do while (a!=0) { do while(( a % … | |
I am tryn a currency converter using hash table. What is the technique to use to enble covert both ways. Ex: Dollers to Euro and Euro to Dollers . I can understand how to do it one way using currency as the hashKey and rate as Hashvalue. (I hope that … | |
Hello, Could you please assist me i want to deploy this application as an executable file with the MYSQL database embedded. I have clean and build the application, the jar file is there but nothing happens. The database is stored on local host. Thank you | |
i recent been using my variables names like this boolean is_dead = false; turn out its not right. right conventions is boolean isDead = false; for some reason i dont like the 2nd one. may be bc i been using 1st one for so long. i was wondering is there … | |
Hey, I need some assistance with an assignment that deals with Jframes. The assignment says "For questions 27 to 31, consider the following class: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class A extends JFrame ( private Container c; private JButton b; private JTextField tf; ) Now for the questions: … | |
Hello guys. I am getting this error when I run this file. Can any of you clarify what is wrong in the code? public class csector_node { public double [] relations; public csector_node() { relations = new double [8]; for (int i = 0;i < 8;i++) { relations[i] = new … | |
i wrote a code to implement some basics of priority queue , but apparantly its not giving desired output. the code is implemented using binary heap as its data structure. i tried tinkering here and there , nut no luck... i want to display a given number of max or … | |
Hi to all, I'm making one application for video control in firm...what's the best way to make application which have to access to webcam? There should be option for watching videos from more cams in real time...I read something on google and I found that Swing framework has some options … | |
les say i have a map: //my map is biiger but this is just a ex. int map[][] = {{1, 1, 1 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}; int camera_pos_x = 0; int camera_pos_y = 0; int camera_speed = … | |
Hi! I recently started teaching Java to myself yesterday via TheNewBoston on youtube. I began working on a few programs from the programmingbydoing website but I'm stuck on this problem:http://programmingbydoing.com/a/gender-game.html It's a problem focusing on nested if statements. Here's my code!: import java.util.Scanner ; public class MainClass { public static … | |
As part of my Uni course i have been given code to edit to create a MineFinder (mine sweeper) game. I have 3 seperate classes to create this game. But for now, my problem lies with this "MineFinderModel class... the tasks i am struggling to complete is as follows: > … | |
Hello, I have build my application and now that I am trying to run the jar file by double clicking on it nothing happens. I tried to access it from my terminal(mac OS) using this line: java -jar "C:\Users\Me\NetBeansProjects\BS1\dist\BS1.jar" But get the following error: Unable to access jarfile Can anyone … | |
hi friends im in need of the basic code for reading a video file as matrices in a frame by frame manner in java. can anyone please help me ? | |
so i got finally done with make my player move right and left, and 1st level. now i want to make my player shoot bullets. i kind of now logic behind it but i need some help. and please let me know if you have a better method of bullet … | |
Hello i m the student of B.E ( Computer Systems ) .. i have to submit my Final year project proposal within 1 month.. my teachers had concerned me to work on android.. but being an engineer student they want a hardware based project from my side.. i have to … | |
I need a little help on writing the following program: Use the Account class to simulate an ATM machine.Create ten accounts in an array with id 0, 1,. . . 9, and initial balance $100. The system prompts the user to enter an id. If the id is entered incorrectly, … | |
I am using Netbeans 7.1 I have 2 jFrame JFrame1 and JFrame2 I just not able to close or hide the JFrame1 when I switch to JFrame2 This is the JFrame1 Code - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try{ int flag=0; String sql="Select * from login;"; smt1=con.createStatement(); rs=smt1.executeQuery(sql); String log=jTextField1.getText(); … | |
i trying to my background move left if user hit right key. and background right if user hit left key. that way it will look like my player is moving. the problem is that when ever i hold right key, the background waits 1 sec than moves to left. i … | |
Hello. I have a project for queues simulation to do and I have to follow the MVC pattern. My classes until now are: Client, Queue which represent the Model, Controller, GUI which is the View, and the Main class. If I have those 2 classes representing the Model, how should … | |
How would you implement "clickable" game elements, like they are buttons. But of course, they can move still. | |
Hi, i want to convert a .jsp file to .java file. I read various forums and they said to use tomcat to convert .jsp to .java.I have ran tomcat but it is not doing anything(i cannot write anything). Through command prompt i ran it and it just opens a new … |
The End.