32,204 Topics
| |
This is my first time making a GUI and we're making a stopwatch...I figured everything out except for how to make the time elapsed have one decimal place ex: 1.1 seconds this is what I have so far [CODE]public void actionPerformed(ActionEvent ae){ stop.setEnabled(true); long endTime; if(ae.getActionCommand().equals("Start")){ display.setText("Start Button was Pressed"); … | |
I have a little problem with my if statement. I have a code where I am comparing if a sprite has moved far enough for another one to generate behind it. Here it is (the dots are choped out code): [CODE]if (unit > 0) { if (moved > speed + … | |
| [code=java]class Rectangle { int x, y; /* dalsi atributy */ public void moveLeft(int distance) { x -= distance; repaint(); } public void moveRight(int distance) { x += distance; repaint(); } public void moveUp(int distance) { y -= distance; repaint(); } public void moveDown(int distance) { y += distance; repaint(); } … |
I know to implement progress bars in Java, is it possible in JSP? | |
Hello everyone, I'm programming genetic processes in java for my project and I want simulate the mitosis of a human cell. A human cell contains 23 pairs of chromosome. Mitosis is basically a cell division, or reproduction, in which a cell gives rise to two genetically identical daughter cells. You … | |
I am trying to automate a login to a website and then navigate to a webpage and retrieve the html from the page. I found some examples of how to login, but am having difficulty figuring out how to navigate to another page once logged in. I've read some information … | |
When i run the Java's window applications with default settings, theme is automatically changed from Aero theme to Window 7 basic theme. However, I wish to run Java's window applications without changing theme. I want to run this with current theme. How can I do for this? Please help me.... … | |
Mary plans a round-world trip in which he would like to visit a number of friends at each city she stops at. She sorts the cities according to the number of friends so she can visit P friends at Pth city of the trip, where k = 1, 2, ...., … | |
I attempted to start ActiveMQ and I am getting a list of error information. I attach herewith the log for your kind reference. | |
Hi all, I am developing an application which needs to comapre voice and match them through java. I am using jsapi and CMU Sphinx engine.But i need to recognize hindi words from the user. Would anyone let me know how can i achieve this ? Thanks & Regards Sachin | |
[COLOR="Green"]Hey Everyone, Started Java for couple of months now and still struggling to put things together.Any assistant will be highly appreciated. I wanted to display an initial menu screen with the following set of options: 1. Display the current score for each possible response. 2. Vote 3. Quit the program. … | |
Write a method that accepts an array of digits (base 10) and creates and returns a new array representing the same fraction but now base 16 | |
How to create a java class to represent linked lists of integers. Provide it with methods that can be used to reverse a list and to append two lists. | |
Hey... don't know why this is happening... I've probably I've done this or things like itat least a few times before... [CODE] public class FileTree { public static DisplayWindow window; public void refresh() { DisplayWindow temp = FileTree.window; //temp.pack(); } public static void main(String[] Args) { window = new DisplayWindow(new … | |
[CODE] import java.util.*; public class Try{ private int [] arr; private final int MAX=10; Scanner scan=new Scanner(System.in); public Try(){ arr =new int[MAX]; } public void accept(){ for(int i=0;i<arr.length;i++) arr[i]=scan.nextInt(); } public int smallest(){ int smallest=0; for (int i=0;i<arr.length;i++) smallest=Math.min(smallest,arr[i]); return smallest; } public int largest(){ int largest=0; for(int i=0;i<arr.length;i++) largest=Math.max(largest,arr[i]); … | |
i was given a project to develop a software that will perform or aid the function of a community pharmacist and i am using a desktop standalone java application,which will be well garnished with GUI component, and will be a distributed system(RMI),and also to use Artificial intelligence technique to implement … | |
| Hello, I have an error on my program, after hours of trial and error I couldn't fix it. I am trying to build a simple server which needs to have threads so more than 1 connection can take place. I don't know if I am doing the threads right, I … |
i am a java begineer and my confusion is: in c++ we have seen that we can initiliaze the array just by writing this- int a[5]; but in java we need new operator for array initilzation as- int a[]=new int[5]; plz explain me in detail the reason for this??? | |
Hello Members, I have a program with a lot of MouseListeners. The issue I am having is the program is ending even before I click. I tried using sleep and flags to pause the program without much success. Just wondering if there is way to get the program to pause, … | |
hey. i want to send a mail from my java application. the code below works fine except that it results in authentication error in runtime.. here is the code.. import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.Message.RecipientType; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SendMail … | |
Hi, The following code is from a textbook. I cannot get it to work. Would someone be so kind as to look at the code as I am coming up with two errors. They are the two lines towards the bottom that read: int die1 = 1 + randomNumbers.nextInt(6); int … | |
Thanks for helping me out with my coding last time. Now I have an error with a class not found for my servlet. In the log, the following shows up: [CODE]SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@1c0e45a cart.CartServlet java.lang.ClassNotFoundException: cart.CartServlet[/CODE] I've compiled all of the … | |
Hi, I am trying to create an editor using JTextpane. Now I need to show a dynamic pop up menu while pressing Ctrl + space. But the problem is that I can trigger the pop up menu only by right click of mouse. The code snippet that I used is … | |
In my class there are 2 objects, I have to get the one which has the smallest size with a method that begins with [CODE]public String smallest()[/CODE] so what I've been trying to do is roughly the following... [CODE]if (object1.getSize() < object2.getSize) { return object1.getName; } } if (object2.getSize() < … | |
[COLOR="Green"][B]hi everyone .. I hope to help me :) .. i have java code.. the main idea of it the user selected from menu the equation (liner - Cubic - Quadratic ) need of them and then user enter the value of x and y and then draw the main … | |
Is there any way to overload the assigment operator or it is not possible in java? Thank you very much | |
how can i passing the list from addCard to printHand? [CODE] public void addCard(Card c){ ArrayList<String> list= new ArrayList<String>(); list.add(c.toString()); } public void printHand(){ for(String i:list){ System.out.print(i+" "); } }[/CODE] Thanks | |
Hi everybody, I have a connection in my database, in this I have an interface which checks if a record has already been inserted in a database or not, when I implement this in a result set, it throws an illegalState Exception, I also have another result set doing a … | |
Hi.. i am getting authentication error while sending mail from my java application.. my java application makes use of SMTP server.. how to solve this..???? |
The End.