32,204 Topics

Member Avatar for
Member Avatar for Niana

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 …

Member Avatar for JamesCherrill
0
148
Member Avatar for Niana

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 …

Member Avatar for Niana
0
2K
Member Avatar for LibraryCode

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) { }

Member Avatar for LibraryCode
0
265
Member Avatar for Violet_82

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 …

Member Avatar for Violet_82
0
4K
Member Avatar for libreriaeben

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 …

Member Avatar for JamesCherrill
0
147
Member Avatar for Bobbyj245

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

Member Avatar for stultuske
-2
564
Member Avatar for efe.osato.5
Member Avatar for Doogledude123

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 …

Member Avatar for JamesCherrill
0
290
Member Avatar for Bartosz

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

Member Avatar for JamesCherrill
0
462
Member Avatar for divinity02

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,

Member Avatar for JamesCherrill
0
276
Member Avatar for nlanka

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 …

Member Avatar for nlanka
0
178
Member Avatar for Bartosz

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; } …

Member Avatar for Taywin
0
286
Member Avatar for sirlink99

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 …

Member Avatar for sirlink99
0
234
Member Avatar for Jack_11

How can I learn GUI java? I've been having some problems with places to learn. Can anybody reccomend a source?

Member Avatar for Violet_82
0
392
Member Avatar for Doogledude123

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?

Member Avatar for JamesCherrill
0
147
Member Avatar for kouty

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 …

Member Avatar for kouty
0
327
Member Avatar for newbie14

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

Member Avatar for newbie14
0
320
Member Avatar for Tierra

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 …

Member Avatar for Tierra
0
298
Member Avatar for Violet_82

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 …

Member Avatar for Violet_82
0
359
Member Avatar for Bartosz

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 …

Member Avatar for Bartosz
0
2K
Member Avatar for kouty

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 …

0
98
Member Avatar for samantha2015

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 …

0
198
Member Avatar for SpottyBlue

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 …

Member Avatar for jwenting
0
244
Member Avatar for Violet_82

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 …

Member Avatar for Violet_82
0
289
Member Avatar for jemdev03

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 …

Member Avatar for jemdev03
0
288
Member Avatar for Mark Louie

Help me :) I want to display the text file in JTextArea but how ? and i want to attach this is searching button.

Member Avatar for stultuske
0
109
Member Avatar for Mysquldata
Member Avatar for prakash2813

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 …

Member Avatar for JamesCherrill
0
328
Member Avatar for Elliander_1

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 …

Member Avatar for ddanbe
0
1K
Member Avatar for WolfShield

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 …

Member Avatar for Asif_12
0
2K

The End.