32,204 Topics

Member Avatar for
Member Avatar for stlcards007

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 …

Member Avatar for JamesCherrill
0
158
Member Avatar for rahul.ch

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 …

Member Avatar for JamesCherrill
0
198
Member Avatar for sengathir

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 …

Member Avatar for JamesCherrill
0
105
Member Avatar for O_mini

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 …

Member Avatar for Taywin
0
3K
Member Avatar for JavaPrograms

How do I put the following output in a table format as shown below in the code?

Member Avatar for JavaPrograms
0
261
Member Avatar for jalpesh_007

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 …

Member Avatar for NormR1
0
356
Member Avatar for s1lkman

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

Member Avatar for Taywin
0
117
Member Avatar for Yarra

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?

Member Avatar for Taywin
0
107
Member Avatar for caswimmer2011

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!

Member Avatar for Taywin
0
141
Member Avatar for regina.elmose

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

Member Avatar for Taywin
0
561
Member Avatar for Hemanth.Satkuri

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 …

Member Avatar for Taywin
0
85
Member Avatar for Hemanth.Satkuri

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

Member Avatar for NormR1
0
126
Member Avatar for khalidshakar

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

Member Avatar for JamesCherrill
0
3K
Member Avatar for ssfox

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 …

Member Avatar for ssfox
0
147
Member Avatar for riahc3

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

Member Avatar for riahc3
0
191
Member Avatar for shibu111

null pointer exception in jdbc how to over come this problem why this null pointer exception is comming in jdbc.......

Member Avatar for NormR1
0
36
Member Avatar for gajoline.marascino

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

Member Avatar for gajoline.marascino
0
158
Member Avatar for vaibhav1983

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

Member Avatar for vaibhav1983
0
378
Member Avatar for subrat_p

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.

Member Avatar for subrat_p
0
120
Member Avatar for Kunal Lakhani

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 …

Member Avatar for Taywin
0
316
Member Avatar for akosivivas

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.. :)

Member Avatar for akosivivas
0
83
Member Avatar for anglwthnati2de

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 …

Member Avatar for anglwthnati2de
0
343
Member Avatar for mcddewitt

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

Member Avatar for JamesCherrill
0
171
Member Avatar for london-G

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 …

Member Avatar for JamesCherrill
0
103
Member Avatar for xixi.li.7

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 …

Member Avatar for JamesCherrill
0
91
Member Avatar for oded.taizi

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?

Member Avatar for pritaeas
0
29
Member Avatar for jalpesh_007

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 …

Member Avatar for JamesCherrill
-1
1K
Member Avatar for poojavb

Is there a way to set Max date in Java for the calendar control or restrict the user from selecting the future dates?

Member Avatar for JamesCherrill
0
200
Member Avatar for Alsobhi

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 …

Member Avatar for NormR1
0
500
Member Avatar for fariajan.siddiqui

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

Member Avatar for JamesCherrill
0
105

The End.