32,199 Topics
| |
When I run the following lines of code the following erroe from the compiler is displayed [CODE]cannot find symbol - method start()[/CODE] CODE: [CODE]import java.lang.Thread; import java.util.concurrent.*; public class MyThread { public static final int MAX = 15; private String message; /** * Constructor with parameters * * @param message … | |
Hey guys, i've been spending some time writing a pokemon clone game in java and was wondering if anyone would like to help me out, it's quite a big project since i'm planning on making it much more than a simple clone, but if you'd like to perhaps help out … | |
i have programming assignment which is to make UDP and TCP client now i already finished UDP ,TCP client and GUI now i want to make the command line class So the assignment tell me that "CLIENT: The client should read input from the command line: • -x <number>, where … | |
Hello! I'm studying right now as an exchange student in Germany and taking my first programming course in Java, and in the last week, things have just started to go over my head and I'm kind of drowning while trying to get all the homework done! The assignment was supposed … | |
I'm been working through my textbook and just can't seem to understand the section on covariant return types. ie) what are covariant return types, what they are used for, etc. The definition in the book is as follows. [QUOTE]An overridden method in a derived class can return a type derived … | |
Hi Can any one tell me how to call a subclass method from a superclass? For example: I have a class A,B and C. Now B and C extends A. So is there any way that we can call a method of B in A? Thanks Abhishek | |
now i'm try to make the delete and successor method for BST in java[CODE]public void delete(BinarySearchTree<V> pointer) { // 1. The node is a leaf. // 2. The node has no left child. // 3. The node has no right child. // 4. The node has two children. BinarySearchTree<V> current … | |
hi all i am facing a problem with the below code i used keylistener so that when i click letter 'v' the program has to exit. But the following code is not working. Help me please.. i think we should add listener to the code but how to add listener … | |
| I think my issue is in line 18. The program runs just fine, but my answer isn't correct when I enter a radius and height. Not sure what I am doing wrong here. [CODE]import java.util.Scanner; import java.text.DecimalFormat; public class ConeA { public static void main (String[] args) { double surface; … |
A snippet: package com.deitel.jhtp7.ch14; public class AccountRecord { ..... Doubt: 1. What does the above package statement imply. As in how(path) this AccountRecord.java will be stored? As in what folder hierarchy should I create? 2. In Command prompt I have set my Current Directory as : E:\RDL\Dropbox\Coding\Core Java\File So will … | |
I wouldn't normally ask for help like this but im getting quite desperate. I really need help with a java assignment that I'm really struggling with (I haven't done any coding in over 2 years so lost just about any knowledge i had) the assignment needs to have a collection … | |
Well hello, i'm about to start my little app. The only task i want it to perform is a left mouse click on a button on the browser, IE, Firefox, Safari... I wonder if this can be done as the click will be performed outside the program window or frame. … | |
[code]public class StringBuilderConstructors { public static void main(String args[]) { StringBuilder sb3 = new StringBuilder("hello"); System.out.printf("buffer3 = %s\n", sb3.toString()); //written in textbook System.out.printf(sb3); //i tried System.out.println("buffer3=" + sb3); // i tried }} o/p: buffer3 = hello hello buffer3=hello[/code] doubt: The book says toString() gives the string representation an object. That … | |
hi i want to use hibernate in java+postgresql but when i run it receive NullPointerException [code]import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.postgresql.Driver; public class FirstExample { public static void main(String[] args) { Session session = null; try{ SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); session =sessionFactory.openSession(); Transaction tx = … | |
I'm creating a small java program that use some special graphics to draw a picture to a certain format. The program will be run as a jar file, and needs some graphics definitions as arguments at initiation. These definitions exist in a small C# class, and should contain only small … | |
Hi, I have been trying to look for some code to add a comment box where people can add or delete comments in my program when viewing items any ideas pls? | |
Hello guys i'm trying to send data to same socket at different times from different java classes. I can easily send the data from one class but after logging in when i try to send data to same socket from another java class ,there is an error. suggest me some … | |
i'm use Netbeans i create JframForm and add a panel to it ,and create new jpanel and add components to it like buttons & textboxs ,finally I'm add the panel 2 to panel 1 but the components of panel 2 not appear and their is no errors. "how i add … | |
Hi, I am working on a tool where the user on click of the button opens a URI, takes screen shot and copies the image in a word document and sends the report to list of users. Im now working on invoking a URI from Java application, I am successful … | |
Hello everybody, I'm trying to make a connection between my mobile and my pc. Im using J2me midp 2.0 to create my code. The jar of my mobile wants to make a connection to the bluetoothaddress of my pc. My mobilecode is based on a MIDlet. But everytime the connection … | |
[B]Hi i wanted to know how to implement a checking system so that whenever my program randomizes a horse it will always be unique. Thanks![/B] [ICODE]import java.util.Scanner; public class Horses { public static void main(String args[]) { String[][] horses = {{"Black ","White ","Gray ","Old ","Young ", "Pink ","Yellow ","Brown ","Orange … | |
Newbie questions. I laid out the controls in shell by GridLayout(2, false). And when user click a checkbox, I wantto to hide one or several lines. I tried to set the exclude to true, and set the control in that line GridData(0, 0) to hide those lines. However there were … | |
G'day everyone, I'm doing at a tutorial on Oracle website and still following it so far. I have come across this formatter "%,8d" and can't seem to work out how it works. I know it's adding a coma to the integral number. The thing that I can get my head … | |
[CODE]import javax.swing.*; import javax.swing.border.*; import java.awt.*; public class ConnectFour { // the grid used for storing the game layout. private int[] [] grid; // the player whose turn it is. private int currentPlayer; public ConnectFour () { // create the grid grid = new int [7] [6]; // initialize the … | |
I am trying to implement huffman coding scheme in java.But I am facing problems in building the huffman tree.How to proceed ?Is there any datastructure in java that will help me to do it?Please help!! | |
Here's the code: [CODE]class SingleBoard extends JPanel { public SingleBoard (ActionListener e) { setLayout (new GridLayout (3, 3)); for (int i = 0 ; i <= 8 ; i++) { buttons [i] = new JButton (); buttons [i].addActionListener (e); add (buttons [i]); } } } public void init () { … | |
[B]In the Code below i have a program using multi dimensional arrays. I have a quick question on "How to" ad a checking system so my random class does not generate the same "type" of horse twice. For instance right now i have my program pick a random color with … | |
Hey Lets see if I can explain myself correctly...... I have 2 projects, one a program and another a library. First project is basically this, more or less (obviously it is more complicated) [code] //This is the main project //Inside com.stuct: //Global.java package com.stuct; public class Global { public static … | |
[B]For some reason whenever i print out the code below "System.out.println("Heat 1:"); never prints but rather somehow just leaves the terminal window. because when i use print instead of println it shows but not when i use println[/B] [CODE] System.out.println("Heat 1:"); System.out.println(heat1[0][0] +"\n"+ heat1[1][0] +"\n"+ heat1[2][0] +"\n"+ heat1[3][0] +"\n"+ heat1[4][0]+"\n"); … |
The End.