32,204 Topics

Member Avatar for
Member Avatar for sariberri

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"); …

Member Avatar for sariberri
0
214
Member Avatar for sirlink99

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 + …

0
81
Member Avatar for kubiak

[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(); } …

0
41
Member Avatar for lse123
Member Avatar for mkab

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 …

Member Avatar for mkab
0
231
Member Avatar for cgeier

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 …

0
93
Member Avatar for tunlinaung

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.... …

Member Avatar for JamesCherrill
0
225
Member Avatar for stupidbumbum

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, ...., …

Member Avatar for jon.kiparsky
0
89
Member Avatar for solomon_13000

I attempted to start ActiveMQ and I am getting a list of error information. I attach herewith the log for your kind reference.

Member Avatar for mKorbel
0
133
Member Avatar for sj5536
Member Avatar for daitkarsachin

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

0
98
Member Avatar for inni2626

[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. …

Member Avatar for inni2626
0
1K
Member Avatar for snehalj

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

Member Avatar for mKorbel
0
94
Member Avatar for snehalj

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.

Member Avatar for jwenting
0
298
Member Avatar for brothman

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 …

Member Avatar for JamesCherrill
0
164
Member Avatar for churva_churva

[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]); …

Member Avatar for javaAddict
0
133
Member Avatar for sam.udo

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 …

Member Avatar for sam.udo
0
111
Member Avatar for 9w43

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 …

Member Avatar for masijade
0
177
Member Avatar for iwannalearn

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???

Member Avatar for lisaroy1
0
152
Member Avatar for sciprog1

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, …

Member Avatar for sciprog1
0
150
Member Avatar for harinath_2007

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 …

Member Avatar for mKorbel
0
245
Member Avatar for lynnajoe

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 …

Member Avatar for lynnajoe
0
213
Member Avatar for Kirielson

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 …

Member Avatar for Kirielson
0
132
Member Avatar for rohit2

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 …

Member Avatar for mKorbel
0
183
Member Avatar for asif49

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() < …

Member Avatar for sj5536
0
91
Member Avatar for Nosa09

[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 …

Member Avatar for sj5536
0
768
Member Avatar for xxmp

Is there any way to overload the assigment operator or it is not possible in java? Thank you very much

Member Avatar for JamesCherrill
0
114
Member Avatar for newbieha

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

Member Avatar for sourabh17
0
81
Member Avatar for omaiaa0p

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 …

Member Avatar for masijade
0
89
Member Avatar for harinath_2007

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..????

Member Avatar for masijade
0
156

The End.