32,204 Topics
| |
I will be implementing MVC model in my program but before that, I have done a simple program based on my understanding of the MVC model. I have three pages: - The user will enter a value in page one and click the next button. - The value will be … | |
Basic Code Requirements •create a project called TheShipment •create at least two classes 1.Main a.contains the main method b.runs the program 2.Shipment a.calculates the cost of the Shipment Main Class (the class that contains the main method) •prompts the user to enter a id and to enter details about a … | |
public static boolean isEmpty(int grid[][]) { for (int r = 0; r < grid.length; r++) for (int c = 0; c < grid.length; c++) if (grid[r][c]==0) { return true; } return false; } the question is : after returning true it back to (for loop) or not ???? | |
Hi, The ticket counter program looks fine, but I have ran into a different problem. It is regarding about the transaction class (lines 64 - 110). After I input the number of tickets to print out, it will register to the transaction class. But when I want to view the … | |
I have been working on this String Split method and the special for loop that I am currently trying to get to properly work does not seem to be working no matter what I do. It keeps printing just the parent directory and not the lower directories. public boolean moveDown(String … | |
Hi Ive been working on this for a while and have everything wokring excep the movedown method which does not work properly. It wont allow me to go to a subdirectory and cannot seem to get it do do properly Ive tried nested loops and while loops none of which … | |
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; // … | |
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 … | |
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") … | |
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 … | |
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) | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
Hi there I am working on a Web application where I need a section called AddNews.This section is under control by Admin of an web application.Admin can add any types of news in the form of Text,Images,Videos and later other user can view it on Latest News section. My Question … | |
| |
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 … | |
i want to get sum of jtable column n that value display in a jtextfield. so what is the code for that? | |
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 … | |
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 … | |
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 … | |
how to extract company name and person name phone number on visiting card java or android code anyone can help | |
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 | |
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 = … | |
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", … | |
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 … | |
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 … | |
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 … |
The End.