32,199 Topics
| |
How can i make the program to tell the user what letter of the alphabet it is: ex: " k is the 11th letter in the alphabet" here is the code that i got so far [CODE]import javax.swing.*; public class Ncom{ String Inputnum; char num; public static void main(String[] args){ … | |
My every figure has centre point with coordinates x, y tips number radius which shows tip range from centre point. i have a drawingRule method which is for every shape i need to draw. [CODE]package business_logic; import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; @SuppressWarnings("serial") public class Vector extends JPanel { public … | |
Hi. I'm new here and need some help. I'm finishing school now and for the finish i need to "make"/program a game or smth. I decided to make a QUIZ in java. I know the basics of java i learned it about 1 year in school. So, i want some … | |
Following me everywhere? why do I get those exceptions very much??? why are they raised?? My classes are always in the same package as the class they accesses them.. I know they are there. Why doesn't the compiler find them???? thanks for your help ppl...please help :@ | |
Hey all - I have to create a basic client browser that creates a socket with a webpage and then uses a command similar to : GET index.html\r\nHTTP/1.1\r\nHost: [url]www.mysite.com\r\n\r\n[/url] To get the source code for the website. I will store each line recieved from the server into an arrayList, which … | |
Hi, I'm having some problems with an infinite loop. For some reason, the process 112 is not being send anywhere. What i'm suppose to to do is to mimic a CPU. Each line represents a process which the first number is the machine time that it suppose to be send … | |
I'm working on a program in which I am using the BorderLayout Manager. However, I'm having a difficult time changing the size of the window. I want to make it longer and more narrow, with only one or two text fields per row and want to make the text field … | |
Hello, I need to read in objects from a binary file and place those objects into an ArrayList. Not sure on how to go about adding the objects - this is what I have so far: [CODE]ArrayList<MailingLabel> arrayOfMailingLabels = new ArrayList<MailingLabel>(); try { ObjectInputStream in = new ObjectInputStream(new FileInputStream("labels.dat")); while … | |
Just need a few pointers with the code below. I have the below class to complete but I am stuck on the isAllValidDigits() method where i have to create a loop to check and return true if all the int values of the authorId array and the programId array are … | |
im creating little program which produces cars, tractors and mopeds. car has 4 wheels and 4 cilinder engine, tractor has same, and moped has 2 wheels and 1 cilinder engine. this is what i have at the moment. next thing i need to do that with 2 factories.. home factory … | |
Hi, I have to do a project on Sudoku. I am finished generating the complete board. Now my major task is to generate a puzzle out of the complete board with the difficulty level. Can some one give me clue to remove the elements randomly from the board. Later on … | |
Hi, I have a rather large binary file that I am attempting to read in, but I only want to read in the first 100 characters or so. I've tried searching the internet for help or an example, but I've only found examples that read in the entire file...and this … | |
hi iam programming bisection method in java but i dont know how to evaluate functions if someone can tell me a class to do it function y=3sinx +cosX example f(a)f(b)<0 | |
Im running windows XP Professional I have all of the latest updates on my laptop and I just downloaded the latest version of SQL Developer but when I try to open the program I receive this error “Unable to create an instance of the java virtual machine.” Ive been looking … | |
| Hey folks :) I was writing some code today, and I wrote a function for computing factorials without use of recursion. What do you think about this one? [CODE]int factorial(N) { int r; r = 0; while (N > 0) { r *= (n-1); n--; } return r; }[/CODE] |
Hi All, I am pretty new to Java and i am having difficulty using overloading on the [I]equals[/I] and [I]compareTo[/I] methods. I have a sample application for a school and i need to check for duplicates in records using the equals and compareTo methods. All records have Firstname, Lastname and … | |
Hi, I am quite new to Comp Sci and I just wrote a program in BlueJ that calculates the value of truth tables and validity in arguments. I followed the book's instructions and have a method with the signature: (It's in the class "Main") public static void main(String[] args) { … | |
Hi! I try to create HashSet of the next object: [CODE] import java.nio.file.Path; public class WatchedPath { public Path dir; public boolean recursive; public Filter filter; // Ctor with only Path - for comparing between the object (comparing is only by the path!) public WatchedPath(Path dir) { this.dir = dir; … | |
1. Create a doubly linked circular list in Java. Each element in the list contains a data which is an object of a Student class and two links, next and previous. 2. The Student class contains two class fields only: • name - The first and last names are in … | |
suppose i created a dequeue class, with methods like insertFront() insertRear() removeFront() removeRear() peekFront() peekRear() isEmpty() isFull() how can i wrap it around and array ?? Will it work the same way as circular does? | |
Hi, I get this error: `Exception in thread "Thread-4" java.lang.NullPointerException` When I try to send the vector to my form. Does someone knows where I made a mistake? Here is a part of my code: (this part is from my clientapplication (where I make a connection with the server) if … | |
Hi i'm implementing a small java program where we have the game running in an applet. After each turn I want the applet to reset to the original setting for the next turn. Basically the game is a football being kicked into the goal. After the goal is made/missed the … | |
I am trying to basically use the methods as functions and then call them in main but I cant figure it out. I thought it could be done like this but maybe I am just confusing my php&mysql class with Java. At the bottom of my code, there is a … | |
[CODE]// this is overkill Date now = new Date(System.currentTimeMillis()); [/CODE] Why is this overkill? | |
Hi all, I have a web app and in the web.xml file there is a filter which is applied to all the jsp files. However I need to change the particular filter so that it is not applied to 1 jsp file. I tried searching in regular patterns if there … | |
Hello, apon summing the rows of a two-dimensional array how can you put the results into a new 2D array so that the results can be sorted from largest to smallest or vice versa? we started with a 7 column 8 row array and now want a two column 8 … | |
I had done a program with JFrame a year ago and I am trying to convert it to with JApplet so I can put it on the web. So far so good and I am able to see the applet and seems every functions are still working... there is one … | |
I am having problems setting up drop down menue for a application I am trying to do for a class. Can someone please give me some pointers. Here is the class assignment. Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage … | |
Hi I'm new to java and working on a program where I want to show the number of rentals for one person in one box and the total rentals in another box. I am having trouble storing the variable or it is not recognizing that I want to keep adding … | |
I am having error in the following code. What should I do to fix it? Also, how should I call it in main method to test the code? please HELP :( [CODE] package sortingelements; public class Main { public static void main(String[] args) { } public int indexOfMaxInRange (int[] myArray, … |
The End.