31,001 Topics

Member Avatar for
Member Avatar for SpottyBlue

Hey, it's been a year never using Java. I want to get help with this, so I was trying to print the number of ticket entered, but got error. Can help? import java.util.*; class Transport { protected double price; // Price per person for each transport protected int seatsRemaining; // …

Member Avatar for JamesCherrill
0
702
Member Avatar for rohtashrathore

Hi All, I have a problem in my jdialog(child) and the parent frame is jframe,it is taking two events to close the jdialog,both from the close caption available at the upperright corner of the dialog,as well as from the button add where i have used dipose() to close on single …

Member Avatar for mKorbel
0
242
Member Avatar for sam_7

my confirm button action listener is not printing the username and password even though I added a Actionlistener for it. please help thanks. Codes LoginDialog.java import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JTextField; @SuppressWarnings("serial") …

Member Avatar for sam_7
0
297
Member Avatar for laguardian

Hello guys! So I'm trying to create this online shopping system for a project. I was wondering if there is a way to gather user input piece by piece then consolidating them in an ArrayList? The first part I'm working on is the registration part. I'm planning to make the …

Member Avatar for jwenting
0
200
Member Avatar for rohtashrathore

Hi All, I want to save values into database through a jdialog when the save or add event clicked.This is child container of jframe which are having many submenu lateron i will add values to these jtable in main menu(jmenu)

Member Avatar for rohtashrathore
0
74
Member Avatar for centenond

So i have 2 players on screen and a player send a attack, what i want is that if x,y are different of x,y destPos move only diagonal towards the destination position. if just x is different well move x only, same with y. I know i have to some …

Member Avatar for JamesCherrill
0
106
Member Avatar for divinity02

can someone tell why am i getting loopin. trying to build this game and it is only looping * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here String p1name, p2name; int p1age, p2age, score, sum = 0; int largest …

Member Avatar for divinity02
0
225
Member Avatar for Start4me

I'm trying to show a user JOptionPane where they enter x and y coordinates each in their own textfield, but I don't know how to store user input as ints. So I need to do something like: int xCorFromUser = xCor; int yCorFromUser = yCor; I have this code so …

Member Avatar for mKorbel
0
1K
Member Avatar for mgold

I've been learning a lot about machine learning (mostly clustering and regressions), but when I've looked into programming libraries/environments, I've found "production ready" ones to be few and far between. What I mean by "production ready" is that it could be incorperated into a product, not just used a tool …

Member Avatar for thaifoodlover
0
346
Member Avatar for thaifoodlover

Dear DaniWeb community, I am not from computer science background (math guy) but I am interested in machine learning and apache mahout. I have used Mahout CLI and recently looked at development environment and wanted to ask you: while running mahout CLI, we do not have dependencies but in development …

0
119
Member Avatar for blindmailreader
Member Avatar for Saboor880

HI to all frndz! I have started learning Java and in a case study I have got some errors I have written a class address book and an error is occurring due to following code snipet persons.add(p); and the error message is: "Address Book has tried to run an unchecked …

Member Avatar for JamesCherrill
0
159
Member Avatar for Gayan Maduranga
Member Avatar for Gayan Maduranga
0
108
Member Avatar for nitin1

I have made very simple code to larn the functionality. String str = "ABC"; InputStream input = new ByteArrayInputStream(str.getBytes()); BufferedReader reader = new BufferedReader(new InputStreamReader(input)); System.out.println(Character.valueOf((char) reader.read())); System.out.println(reader.read()); System.out.println(reader.read()); System.out.print(reader.read()); Secondly this one, String str = "ABC"; InputStream input = new ByteArrayInputStream(str.getBytes("UTF-8")); System.out.print(input.read()); System.out.print(input.read()); } output is same for the …

Member Avatar for JamesCherrill
1
3K
Member Avatar for nitin1

I have one project named P2PTicTac. I have one file named layout.java. and one with CLient.java. I have made simple GridView in layout file with 9 buttons in 3*3 Grid. I have run two threads in client.java. One for reading the data from server and one for writing data to …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Saifuddin_1

I'm creating a wizard page in eclipse using SWT libraries. So far I have succeeded in creating the page but with only one issue:- SWT composite doesn't get selected. My wizard page contains a scrolledComposite containing multiple composites in a grid fashion. Each composite contains a browser just like a …

Member Avatar for Saifuddin_1
0
242
Member Avatar for Benjamin_13

i am developing a mobile game application and i need your help How to code a counter that give marks to a player in a cetrain game? thank you

Member Avatar for JamesCherrill
-1
33
Member Avatar for nitin1

public class Input { static InputStream reader = null; /** * @param args * @throws IOException * @throws InterruptedException */ public static void main(String[] args) throws IOException, InterruptedException { Test test = new Test(); test.start(); String str = "1 21"; // Scanner scan = new Scanner(System.in); try { reader = …

Member Avatar for JamesCherrill
0
134
Member Avatar for manalibhadula

Hi I have written a code for sending a mail, it was working fine before and now it hangs at tranport.send(). Can any one help, here my code `Inline Code Example Here` try { System.out.println("Sending Email initiated..."); Properties properties = System.getProperties(); properties.put("mail.smtp.auth", "false"); properties.put("mail.smtp.starttls.enable", "true"); properties.put("mail.smtp.host", _host); properties.put("mail.smtp.port", _port); properties.put("mail.smtp.connectiontimeout", …

Member Avatar for manalibhadula
0
2K
Member Avatar for jsefraijeen

i'm a newbie in java and i got an assignment to do and i don't know how to start ... the problem is: Write a program that will compute for the product of two numbers without using the * operator.. Sample Output: Enter Num1 :___ Enter num2 :___ Product is …

Member Avatar for JamesCherrill
0
9K
Member Avatar for laguardian

Hello there! I've created a method that searches for the customer with the highest deposit. Here's what I have so far: public Customer searchHighestDeposit(ArrayList<Customer> customers){ for(int i=0; i<customers.size();i++) if(customers.get(i).getBankAccount().getBalance()>customers.get(i+1).getBankAccount().getBalance()) return customers.get(i); else return customers.get(i+1); return null; The output is kinda weird: "The customer with the highest deposit is: bank.Customer@c390508" The …

Member Avatar for JamesCherrill
0
178
Member Avatar for bhupen8

Dear all, i am trying to design a purchase form in which i wish to use jtable , when i press any character into the cell it should open a jlist with populated values from database and which let me select only one item from there and get the selected …

Member Avatar for JamesCherrill
0
217
Member Avatar for laguardian

Hey guys! So I'm working on a program that accepts 7 user inputs then stores them in an ArrayList. Then it replaces elements that start with the letter "B" with an aterisk. I'm getting a IndexOutOfBoundsException. Here's the code I have: ` package arraylist1; import java.util.*; public class ArrayList1 { …

Member Avatar for JamesCherrill
0
131
Member Avatar for Doogledude123

I have a custom ListCell in which I have methods to move the position of the cell to the right or left, but I want a button to be shown similar to deleting a Conversation in Messages on iPhone. If I add a new ImageView, which will act as the …

Member Avatar for Doogledude123
0
692
Member Avatar for pooja3107

Hi, I am getting java.lang.ArrayIndexOutOfBoundsException: -131072 exception. when i am running the code from my local machine (eclipse) it works fine, when i copied my code to unix server, the same code is giving error. Exception trace: =============== In generate Report Method ================= java.lang.ArrayIndexOutOfBoundsException: -131072 at xlrd.biff.CompoundFile.<init>(CompoundFile.java:282) at xlrd.biff.File.<init>(File.java:86) at …

Member Avatar for pooja3107
0
387
Member Avatar for laguardian

Hey guys! So I'm making simple PetShop program based on an UML diagram I did. Anyway, I have 4 classes: PetShop(It's the main class), Pet, Customer, Transaction. I'm having an error on line 22 saying it cannot find symbol. I have the adopt() method in the Transaction class. Here's what …

Member Avatar for laguardian
0
200
Member Avatar for alex0220

Hello I need help with this java tax assignment it is asking to Write the Java code needed to perform the following:• Calculate state withholding tax at 6.0%, and calculate fed-eral withholding tax at 25.0%.• Calculate dependent deductions at 2.0% of the employee’s salary for each dependent. public class Payroll.Java …

Member Avatar for Schol-R-LEA
0
434
Member Avatar for alex0220

Hello I need help with this java tax assignment it is asking to Write the Java code needed to perform the following:• Calculate state withholding tax at 6.0%, and calculate fed-eral withholding tax at 25.0%.• Calculate dependent deductions at 2.0% of the employee’s salary for each dependent. public class Payroll.Java …

Member Avatar for stultuske
0
195
Member Avatar for divinity02

Hi every I am doing over my programming final project trying to see where I have gone wrong. And slowly am beginning to see some of my mistakes, I guess I was a bit overwhelmed anyway, the is part is where I was and still a bit confused. What is …

Member Avatar for divinity02
0
354
Member Avatar for sankubha

Now am using substance look and feel version 5.3.I want to upgrade the it to latest version 7.2.1. I need to know what is the new features in new version and difference between 5.3 and 7.2.1.why we need to prefer the new version.

Member Avatar for Schol-R-LEA
0
349

The End.