32,204 Topics
| |
I have in my program an object of a class. When I try to print it out I am getting "Address@33909752" - guessing it is a hash code. I also tried to override toString method, but still didnt help Address address = new Address(city, country, houseNo, street, postCode); Is there … | |
I am having trouble getting value from getter. I am trying to access the getter method from another class but it returns null. In my Registration Class I have a constructor and getters. In my Client Class I have set the values using Scanner. I would like to create Report … | |
I have a jbutton ,which once clicked ,counts the clicks: int clicked ; private void jButtonScanActionPerformed(java.awt.event.ActionEvent evt) { clicked++; } My question is how to attach this click output(once the button is clicked ) to jtext field to see the click count? private void jTextFieldParcelIDActionPerformed(java.awt.event.ActionEvent evt) { } | |
Hi guys, I'm now looking at what seems to be a nice exercise on my java book. Basically, the exercise asks me to build a virtual keyboard GUI - see screenshot - and when you press each key on your real keyboard the key you've pressed will change its background … | |
I am trying to create a method entitled rolledOneOnlyOnce that takes in two integers as parameters and returns a Boolean. This method must be public and static. In this method, the integer parameters represent the values currently on each of the Game’s die (die1,die2 respectively). Here, you will want to … | |
Minimal Submitted Files You are required, but not limited, to turn in the following source files: Assignment8.java(More code need to be added) Food.java (given by the instructor, it needs to be modified for this assignment) IdComparator.java (Need to be completed) CategAndNameComparator.java (Need to be completed) Sorts.java (Need to be completed) … | |
pls i need help in creating a traffic control system .for my project | |
I was wondering if it would be more efficient to render a single BufferedImage instead of rendering a bunch of BufferedImages in a double for loop? I have an idea of how to do it, I just don't know what methods in BufferedImage you would use to create the bigger … | |
I am trying to assign a method to a varibale called from a constructor, but it returns null when I am calling it. public class ProjectManager { Calculation a = new Calculation(); private Scanner in = new Scanner(System.in); private Scanner price = new Scanner(System.in); private Scanner duration = new Scanner(System.in); … | |
hi all (james) i have another question: if yuh want to use the random numbers, it goes like dis: random generator = new random() or it have the math.random right my questions are how do u get to generate the 2, 3, 4- times table, | |
public class NaveenSingleton { private String name; private String [] names; private static NaveenSingleton uniqueInstance; private NaveenSingleton() { } public static NaveenSingleton getInstance() { if(uniqueInstance == null) { uniqueInstance = new NaveenSingleton(); } return uniqueInstance; } public void setName(String n) { name = n; //Search for duplicate name here, before … | |
Hello there, In my program I have an object of a class with some values, and I am trying to create another object, populate it to array and add it to my object. class AdvertisementType { public String getWebAdvert() { return webAdvert; } public String getEmailAdvert() { return emailAdvert; } … | |
Hello everyone! I am writing a GA, and I am trying to implement elitism. My problem is an interesting one. I cannot release too much code because it is an ongoing assignment. I have asked the TA, and he is unable to find the solution as of this moment. The … | |
How can I learn GUI java? I've been having some problems with places to learn. Can anybody reccomend a source? | |
I'm used to using AWT's Canvas and BufferedImage and things like that. I've switched from using Canvas for drawing, to using a JPanel and I'm blown away by the efficiency. I intend on fully using Swing for all of my GUI. My question is, what is Swing's equivalent of BufferedImage? | |
Hello. My question is very basic but I can not find/understand the answer anywhere. How check if the name-value "name": value in an object. I know that with Object.keys() method we can checking the names of the properties. I know too that with Object.name or Object["name"] we can see the … | |
I have done a socket programming using bonecp as the database pooling for mysql. Suddenly I notice a lot of socket connection made but then after a few hours I got too many open files. I have set the timeout but somehow it did not timeout I don't know why. … | |
We have homework due tomorrow, and it's a three person group. I don't understand the slightest bit about arrays, but I've been trying - now the code just looks messy. Just with the things that say ------------------Tierra------------------, can you all help me? The book is useless and I'm just frustrated … | |
Hi guys, with event handlings it seems that there are 2 approaches: 1)using an anonymous inner class 2)using a normal inner class. From what I can see if you have more than one component that is generating an event, say you have 3 buttons, if you go down the route … | |
Hello, I am having a problem with my application. I have designed a class - DisplayClientRequest which has a constructor and some setters and getter. Apart from this i built very simple JavaFX GUI application. For instance if I create a method in my DisplayClientRequest with paramteres, how would I … | |
Hello. My question is very basic but I can not find/understand the answer anywhere. How check if the name-value "name": value in an object. I know that with Object.keys() method we can checking the names of the properties. I know too that with Object.name or Object["name"] we can see the … | |
Hello I have a rest web service which implement oauth2.0 . Now I have my web application with a login which currently using spring security. I want to use the same login to authenticate with the rest web service using oauth2. My question is: Does this tutorial is suitable for … | |
Hi, I was having problems with the pet store java code. The class pet has private attributes, but i cannot use the extender class. Can help me? import java.util.*; public class Pet { // Private fields private String species; // Species name private int ageInWeeks; // Pet's age in weeks … | |
HI guys, as I'm gettng into Java GUI again after a long time, I'm trying hard to remember things, but not everything is that clear anymore. I'm in the process of building a very simple GUI application with a few buttons. First question is about the JFrame and JPanel. From … | |
Hello, I need help with android programming. The problem is that I can't make this portion of my codes to work the way I want to. I want to simply: - Delete a record inside the SQL lite database - Delete the record also inside the AlertDialog Single Choice Item … | |
Help me :) I want to display the text file in JTextArea but how ? and i want to attach this is searching button. | |
Does android support other language than java? | |
Hello all, I am trying to implement memento design pattern in my project to add and remove products from cart. I have abstract product class and sub classes like Book, Software, Phones etc.. I googled and found some examples using three classes : 1) Memento 2) Originator 3) Caretaker I … | |
I am trying to get an object to move along a sin path in JavaFX. I found a few ways of generating the sin graph, but each of these used extra features and just ended up creating a window separate from the one the ball object generates in. I thought … | |
I'm wanting to make a voice controlled program, But when I type: 'import javax.speech' into NetBeans it says that 'javax.speech' doesn't exist. I then downloaded Free TTS, copied the speech.properties like I was supposed to. It still is showing the error. I did some more research and found a place … |
The End.