32,204 Topics
| |
I need help with the if else statement below. I am trying to use branching to determine and drawString to find the longest lines between the points. Everything I try with the branching method seems to give me errors so I have no idea what to do and it is … | |
Given: Sour extends Blue extends Pan `Pan p4 = new Sour();` Then set of 6 new statements given and asked to choose which ones will compile. They are: 1. `Pan p5 = p4;` 2. `Pan p6 = (Blue)p4;` 3. `Blue b2 = (Blue)b4;` 4. `Blue b3 = (Sour)p4;` 5. `Sour … | |
hi, when i try to multiply the double value with 100, i got inconsistent o/ps.. here the codes... Case1:- double d=15.025d; System.out.println("d="+(d*100)); o/p:-d=1502.5 Case 2:- double d=16.025d; System.out.println("d="+(d*100)); o/p:- d=1602.4999999999998 and this issue to 17.025,18.025,19.025 & 20.025 also. it suppose to be d=1602.5 right? why these particular o/p and how … | |
Hello, thanks for taking the time to read this. I'm working on (what should be) a simple, simple java program, I am very new to java so please bear with me. I'm writing code with a method that takes an array of int values and determines if all the numbers … | |
How do I put the following output in a table format as shown below in the code? | |
Dear all, I have declared following two hashmap. `public static HashMap<Integer,String[]> m1 = new HashMap<Integer,String[]>();` `public static HashMap<Integer,String[]> temp = new HashMap<Integer,String[]>();` At starting point of my execution both map will contain key from 1 to 20 and mapped value with it. Means key value pair are same in both … | |
import java.util.*; public class MyLinkedList { private Node head; private class Node { private String element; Node link; } public MyLinkedList() { head=null; } public void insertAtHead(String ele) { Node curr = new Node(); curr.element = ele; curr.link = head; head=curr; } public void insertAtTail(String ele) { Node curr = … | |
How do I graph a parabola using an equation where the user can just input an angle and velocity. And is it possible to have an object follow this path? | |
Hey, I am trying to use a for loop inside a recusive method, but everytime the method runs recursively, the integer in the for loop resets to zero because of the initialization. Is there anyway to keep the integer counting up, and not resetting to zero? Thanks in advanced! | |
I apparently can't figure out what I am doing wrong....I have been reading all day and googling help but it hasn't helped. Here's what I have... public static void main(String[] args) { ArrayList<Animal> animalCensus = new ArrayList<Animal>(); Scanner input = new Scanner(System.in); //int uniqAnimal = 0; //String animalName; String endList; … | |
Help me in constructing a MySql Query to retrieve the rows based on datetime column. Below are the conditions: 1)The date difference between today and date in that column sholud be =>2 days. 2)If the day of the date in DB column is Thursday/ Friday then the date difference between … | |
I have a Date Picker code. Can you help me in constructing the Time Picker . Or can you suggest me some websites/materials to refer Thx in Advance | |
** Please Help. When I call this class, it causes the program to stop responding? Actually I used a button must be clicked to start call the class in another class to run it. after I press that button it causes the program GUI to stop responding. I am developing … | |
Hello everyone, Im new in web development, Im using localhost (XAMMP),I'm trying to make my website which basically allows users to compile and run their submitted java program on my server(my web page).Essentially, I want when the users click a button(upload) they upload file from file source(e.g desktop or anywhere … | |
I was going to start Apache/Tomcat as root but Ive rethought it and have gone against it. How can I make my web service read/write from "/"? I keep getting permission denied exceptions... | |
null pointer exception in jdbc how to over come this problem why this null pointer exception is comming in jdbc....... | |
class ThreeException extends Exception { /** * */ private static final long serialVersionUID = 1L; static int count = 0; public static void main(String[] args) { while(true){ try{ if(count++ == 0) throw new ThreeException(); System.out.println("No Exception"); } catch(ThreeException e){ System.err.println("Three Exception"); } finally { System.err.println("In finally clause"); if(count == 2) … | |
Hi All, I have configured a spring JPA project but when I deploy and start the tomcat I get the exception nin stacktrace as shown below. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/database-config.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: … | |
I want to do a project on hotel management. But I can not know how to take the print of the bill of a customer. After I entered data in textfield how to take printout those data in a money receipt format. | |
I have created an application using swing. On clicking a particular menu item, a form is loaded,and after saving it a pdf generates. For reporting, i am using iReport. Here is the code snippet MyiReportViewer.java package sms.ui.ireport; import java.awt.BorderLayout; import java.awt.Container; import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import … | |
Supposed i will input a string like "java"but the display will change instead of "java" the display will change every character and become **** please help.. :) | |
Hi I have this code that performs error checking on initial values. Everythinbg works good but how would I go about allowing for user input? I am thinkging JOptionPane but where would I add that? public class Date { private final int month; private final int day; private final int … | |
Hello I am having trouble converting a long (cents) into currency format. My Code: l long doublePayment = 1099; //Should equal $10.99 DecimalFormat dFormat = new DecimalFormat(); String formattedString = dFormat.format(doublePayment); System.out.println(formattedString); Output: 1,099 I also tried: long doublePayment = 1099; NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US); String s = n.format(doublePayment); System.out.println(s); … | |
Hi, I don't know what happen all a suden but all my textfiels variable are now underline in red. I have : st.setString(1, t1.getText()); st.setString(2, t2.getText()); st.setString(3, t3.getText()); Where t1,t2 and t3 are my textfields variable name but is says cannot find symbol. Everything was working fine, I don't understand … | |
I need a help with this Java project. And please note that Iam not try to cheating to complete this project,my teacher is give the permission to use any source to help do this project and I'm not plagiarism I will give the credit to the source code in this … | |
hello, i have this code $divToSubjectShow = "<div id='subjC".$subId."'><div class='boxC'>".$subName."<span onclick='delTempSubject(subjC".$subId.")'>X</span></div></div>"; to store in div innerHTML with js and i get this error > missing ) after argument list any idea? | |
Dear all, I have stuck with one problem. I have taken one Hashmap, Performing some input operation,remove operation on it. So after performing remove operation, i want value of 2 successive key in two different array. Also i want to match 1st key's value with all other keys' value. Like … | |
Is there a way to set Max date in Java for the calendar control or restrict the user from selecting the future dates? | |
Hello I'm new learner in java, and I'm facing a problem to develop a Java application that will ask the user for the time in terms of hour and minutes and display the time by drawing a clock. I have created two classes, and the code is below. Please could … | |
hey iam writing this code in button's actionPerformed but it doesn't displaying any image . Can you identify what is problem in it??? JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("Images","jpeg", "jpg", "JPG", "JPEG", "gif","GIF", "png","PNG"); chooser.setFileFilter(filter); if (chooser.showOpenDialog(this)== JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); ImageIcon icon = … |
The End.