32,204 Topics
| |
I am facing this problem where one thread keeps adding packets which it receives from the network to linkedlist. And the other thread retrieves it from the linked list. The below is the code of the Thread which keeps receiving the packets and add's them to list. [CODE] private class … | |
I created a piece of code that simulates a pendulum with the gravity(assuming no friction or resistance). However, it is not as smooth as I want it to be. So.. does anyone know what I can do to make it smoother? [CODE=java] import java.awt.*; import java.awt.event.*; import java.lang.Math; import java.lang.Runnable; … | |
Hi, I'm reading this book about Java right now and in it was this example so I wrote it off and tested it... I get the error "Exception in thread "main" java.lang.NoSuchMethodError: main" and from what I've understood it's because I am missing a main class... Here's the deal though: … | |
Hello Daniweb. I am trying to make an application for a ATM machine (class homework). This is the schematic that I followed [url]http://www.screencast.com/users/haxtor21/folders/Jing/media/303e583a-8f90-46f3-8ed1-a35dde2200bb[/url] My issue is that I'm trying to access a text file and search for a account ID. After the account ID i am doing a nextDouble and … | |
I'm doing a phone number conversion program. I created a method to convert the letter to numbers, and a method to format the phone number(dashes after 3 and 6 numbers). Both methods return a value. I don't want to post the entire program, but the calling method in the main … | |
hey everyone, i have few text files that contain some data. what i need is to be able to display those file names in JTextArea and if the number of text files increase/decrease i would want the file names automatically change in the JTextField(after next compilation). i would be very … | |
I am writing a program that is supposed to count the number of vowels in an inputted (by the user) body of text. [CODE] import java.util.*; public class Vowels{ public static void main(String[] args){ Scanner console = new Scanner(System.in); int counter= 0; System.out.println("\nInput a sequence of characters"); String text = … | |
I could not get this past my editor, and am not bright enough to understand why. My TA and I do not share a common language fluency and I do not understand remotely what he is saying. Can anyone tell me why this doesn't run? [CODE]import java.util.Scanner; public class sumMatrix1 … | |
Hi, I need a little help, i found out to repeat an action/animation automatically I need to use a timer but im having troubles implementing it into my script. This is the last few part of the action... public void slowMoveVertical () { sun.slowMoveVertical(-100); } Now I what I want … | |
I have to write a code that displays a 4 x 4 grid of faces. I am stuck and this is wat i have so far: [code] import java.awt.Graphics; import java.util.Scanner; import javax.swing.JApplet; public class Program7 extends JApplet { public void init() { setSize(2000, 2000); } /** * Draw one … | |
Hopefully this is my LAST QUESTION!! D:< Anyway, I saw a code on lloydgoodall.com for an LWJGL FPCamera. It had SEVERAL errors, but I finally got to the (hopefully) last error. "Keyboard must be created before you can query key state" My code: [code] import org.lwjgl.Sys; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; … | |
[code] import java.util.*; package everything_is_an_object; class MyClass { int i; char c; } public class Main { public static void main(String[] args) { MyClass x = new MyClass(); System.out.println(x.i); System.out.println(x.c); } } [/code] My error is on the second line,that was generated by my IDE,with the package. What si the … | |
I have to create a class called Polynomials and other called PolynomialTerm. The latter one to copy, add and multiply PolynomialTerm (exponents, coefficients). I also have to do the same for the Polynomial(which is an arrayList of PolynomialTerms). I am having problems adding the two polynomials.I need to do this … | |
Hello, I have a project in BlueJ, called Game. Inside this project, I have the following files: File_A - A JApplet file which creates instances of Class_A and Class_B and calls their respective member functions. File_B - Implements Class_A (a JPanel) File_C - Implements Class_B( a JPanel) In order to … | |
Hi , i have created web application in that i want to get the facebook user profile like image, name , education etc. can any one plz suggest which API i need for that or what are the steps i have to take for to fetch profile in JAVA. | |
Hello All, I am having some troubles with my code, which is: [code] import java.net.*; import java.io.*; class TestInet { public static void main(String args[]) { try{ InetAddress inet = InetAddress.getByName("72.14.203.106"); InetAddress inet1 = InetAddress.getLocalHost(); InetAddress inet2[] = InetAddress.getAllByName("www.google.com"); //InetAddress inet3 = InetAddress.getHostName(); System.out.println ("Host of IP is[inet.getByName]: " + … | |
Here is my code. [CODE]import javax.swing.table.*; import javax.swing.*; import java.util.*; import java.awt.*; import java.awt.event.*; import java.awt.print.*; import java.awt.geom.*; import java.util.Calendar; public class Salary_report extends JFrame implements ActionListener { Vector data; JTable table; JLabel banner; ImageIcon images; Container c; Employee_report f1; JButton print; String s,days,basic,pf,hra,esi,bonus,advance,allowance,loan,incentive,dother,da,eother,gross,ded,net,leave; double ge,td,np,l,l1; public Salary_report(Employee_report f1) { … | |
Hey guys! I'm trying to make this flowchart but I not quite sure how to do it. I'm supposed to make a flowchart that will ask the user a specific month and year, and the output would be how many days that that inputted month and year has. Kinda confused … | |
I want to create a new thread in a program that i'm working on but i cant get my new threads to start does anyone have some code that would allow me to create and start new threads | |
Hello World! Im doing a simple program that runs a JFrame and has some JButtons etc etc but id like to put a simple sound to one of my buttons, when i quit the program i want it to play a simple melody how can i put it in this … | |
Hi, I'd like to implement the following but I have no idea where to start: I have a JTable with 1 column containing Date. Now i'd like the cells in this column to be editable. I have a datepicker that i'd like to pop up when this cell is clicked … | |
I've toyed around a great deal trying to get my calculations correct in this countdown program, but I keep getting the same result. Basically, I'm creating a program that will countdown from a users inputted number. At each second it will display whatever amount of seconds remaining. My problem is … | |
Is it possible to add two separate arrays into one hash set? | |
Hi, I'm writing code for a graphical map of a shopping center. Whilst writing the code I realised it would be simpler to be able to draw objects using "names" instead of values. E.g. g.drawRect(Asda); instead of g.drawRect(100,100,40,40);. Is this possible? I have tried writing various classes but I can't … | |
Hi, I need to store data entered into my java application such as the persons name, address, ph number, date etc to be saved in an xml file. I also need to retrieve it so it can be displayed. If you can point me in the right direction that would … | |
Hey, I have tried everything that does not work to change the color of the text on a JButton I have in a JPanel. Does anyone know how to do this. I need the actual text on the button to be a different color than black..This is an application so … | |
hi All, my issue i have a clob data type in hibernate mapping , and i have one textarea from where the data will come , that will be big data , that is actually the data for webpage , now if i want to know how to get that … | |
Hello =) I have some problem to set font and color in my program.can you take a look for the moment please?Here is my simple program: [code] import java.awt.event.*; import javax.swing.*; public class showYourLove extends JFrame //inherits from JFrame class { private JPanel panel; //to references a panel private JLabel … | |
Hi, I am developing a web-based application with Google Web Toolkit. In addition to the web-based application, I also have a desktop Java application to monitor data on the local machine. However, I want to use GWT RPC to make procedure call to the remote server, but I have tried … | |
Hey guys I found the following code snippet below... I want to know how to compile this... I am a c++ programmer and something is wrong with my mouse/audio so I thought this may programmatically solve it but I have no clue about anything java and in c++ there is … |
The End.