36,051 Topics
![]() | |
![]() | [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 … | |
Hello, to the forum. I have stuck on a point for my coursework. I have a xml file that containts 4 category tags (but with different attribute name), inside i have 4 item and inside any item i have <name><price>...etc. There is a way to take those tags (<name><price ..etc.>) … | |
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..???? | |
I'm getting errors, and I'm not sure why. Any help would be appreciated. I'm working on this program and when I put the ActionListener for the comboBox it blows up. I chose a topic from the comboBox that will pick a file to be read. When I comment out lines … | |
I have an interface built in javafx but it currently does nothing it just looks nice. How do you download files from the web in javafx or java? How do you create files on the users system in java or javafx? How do you place downloaded files in the created … | |
My question is based on class relationships. I've written code for 2 classes, one of the "public int..." bits in 1 class has a variable which holds the cost of something. In the other class a variable holds the weight of something. I want to multiply the weight with the … | |
I need a little help please,here is my question: How can I get the current index in a jComboBox? I searched it on google and i cant seem to find any answer. I need to get the index of the item that I select from a Combobox. Please help | |
Hello again everyone! I'm having a problem with this JFrame: [ATTACH]20095[/ATTACH] The JButtons "Add Entry!" and "Cancel" have an actionListener. When I press either button, nothing happens... Attached herein is the code: Forgive my code; it's rather long...as I'm still starting... And please do not mind the comment above the … | |
My code compiles successfully but doesn't run why?? What problem whatsoever is with the syntax????? [CODE]import java.util.Scanner; public class uppercase{ public static void main(String args){ Scanner in=new Scanner(System.in); System.out.println("Enter string:"); String str=in.nextLine(); for(int i=0;i<str.length();i++) {if(i!=str.length()-1&&str.charAt(i+1)>='a'&&str.charAt(i+1)<='z'&&str.charAt(i)==' ') { str = Character.toUpperCase(str.charAt(i)) + str.substring(i+1); } } if(str.charAt(0)>='a'&&str.charAt(0)<='z') str = Character.toUpperCase(str.charAt(0)) + str.substring(1); … | |
hi i am answer this question , but i didnt know what the errore with cast represent uppercase letters, lowercase letters and a considerable variety of special symbols. C++ uses small integers internally to represent each different character. The set of characters a computer uses and the corresponding integer representations … | |
Hello, I recently took up a challenge to make a full screen pong game in java. So far it is full screen, it does the basics (bouncing off floor/roof/paddles) with a minor point system. I also added support for every 20 seconds it speeds up the ball by 1pixel per … | |
Hey Im sure everyone is familiar with the game connect four right? Well I am trying to make it in Java right now but I am stuck right now. Can anyone help me with this? Here is the question straight from the book: Connect four is a two player board … | |
Hi , I am trying to get HibernateCfgXMLFile and HibernatehbmXMLFiles in new file option. So,that i can get document types automatically.. How can i do this... i added hibernate jar files also... now i am checking the hibernate option in open perspective option in the menu of eclipse... But there … | |
Hello everyone! My name is Uriel, and I'm from the Philippines. I'm currently doing our machine problem in Java. I'm using the BoxLayout for this GUI. [ATTACH]20069[/ATTACH] I can't seem to find the correct set of codes to make these buttons function. What codes do I use for these buttons … | |
i want to repeatedly replace e by o from the words Hello World to be Holle Werld [code]import java.awt.*; import java.applet.*; import java.lang.String; import javax.swing.JOptionPane; public class StringExercise1 { public static void main(String[] args) { String textString; textString = JOptionPane.showInputDialog("Enter a string:"); replaceAll(textString); System.out.println(); System.exit( 0 ); } public static … | |
hi:::: i hope very bady good? how threads are implemented in an operating system of Windows xp?how threads are implemented in the operating system?how user level threads map to kernel threads and threading models used by that operating system ? | |
I have an installer application I am building in javafx but I can't figure out how to get the operating system it is running on so I can place files in the right locations for each system and so I can customize the interface for each. If anyone has any … | |
I have developed a program applet and frame in it the program is perfect but i dont how to know run it in command prompt | |
Can someone please help me find a method to this? The following recursive method addeven (...) is supposed to add the even indexed values of an array, i.e., a[0] + a[2] + a[4] + … There are bugs in the method. Trace the method using test data, find the bugs, … | |
Okay, So this code I have is giving me an error: non-static variable this cannot be referenced from a static context. Here is the code: [code=java] package macey; /** * @author WolfShield */ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class DemoConv implements ActionListener { private JLabel answerL; public static … | |
Grating everyone I've to write a program that know how two animals related to gather, the program should first read the number of cases from file , and then the size of two matrices. i did that. and then should compare the first matrix with size 4 with the second … | |
hi, im doing a project on jsp..which is a file uploading program i have a file chooser and i want the file choosed by the user to be stored on my server. how should i do that.. please help me my code is given below--addphoto.jsp [CODE=JSP] <html> <head> <meta http-equiv="Content-Type" … | |
Hi, I was a beginner in java.I was trying to connect to database(oracle) with the deatails user:scott pass:tiger host string: PC0128166 with code as [CODE] Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); connection =DriverManager.getConnection("jdbc:odbc:abhi","scott","tiger");[/CODE] But i was getting the error as [CODE] Exception is ;java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-12560: TNS:protocol adapter error[/CODE] problem is the same … |
The End.