32,199 Topics

Member Avatar for
Member Avatar for Ant695

/*Additional selection structures 16/3/2015 Programme to display weight on a given planet*/ import java.util.*; public class planets { public static void main (String []args) { Scanner keyboardIn = new Scanner (System.in); int weight; char planet; double planet_weight; System.out.print ("Enter your weight"); weight = keyboardIn.nextInt (); System.out.print ("Enter your planet of …

Member Avatar for JamesCherrill
0
184
Member Avatar for victorblue
0
76
Member Avatar for Ragunath_1

I want to automate an application developed in java and swing controls using python. I tried pywinauto but it is not able to detect java objects. I tried using QTP but my applications dynamic java windows dosen't hava parent window so not able to use it . Any suggestion of …

Member Avatar for vegaseat
0
67
Member Avatar for michael.james.90475

double fileSizeKB = (fileByteArray.length) / 1024; double transferTime = timer.getTimeElapsed() / 1000; double fileSizeMB = fileSizeKB/1000; double throughput = fileSizeMB/transferTime; System.out.println("The size of the File was "+fileSizeMB+ " MegaBytes"); System.out.println("Time for transfer was " +timer.getTimeElapsed()/1000+ " Seconds"); System.out.printf("Throughput was %.2f MB Per Second\n",+throughput); System.out.println("Number of retransmissions: " + retransmissionCounter); byte[] …

Member Avatar for JamesCherrill
0
230
Member Avatar for Doogledude123

So I know in a Tile Based game its more effecient to have static final instances of each tile, then populate your array with those instances. But what about Rendering? You have to pass the position that tile should be rendered into your method you use for rendering. Is there …

Member Avatar for JamesCherrill
0
172
Member Avatar for gahhon

I have facing few problems with my lab questions. and i am using BlueJ software for my lab work. 1. Are two objects equal if their state is the same? And i answered No, however they are still different objects with the same state. But how can i explain it? …

Member Avatar for gahhon
0
201
Member Avatar for Shilpa_3

I am trying to develop an interface for my hotel reservation system where for a particular date, the interface should display rooms that are booked so that the staff can book the rooms that are available (similar to airline seating reservation system which displays reserved and open seats) Can I …

Member Avatar for stultuske
0
185
Member Avatar for Gurjeet Singh

Who can help me and guide me through the setting up the server using Netbeans/ Tomcat. It is necessary and I have tried it many times, but not able to do it until now.. Please help/ guide.

Member Avatar for Shilpa_3
0
139
Member Avatar for compscigirl

Hey everyone! I have to write a program that generates random shapes in a window, but when the window is resized the program can still remember the shapes and redraw the same ones. My code so far draws the random shapes, but when I resize the window, the shapes change …

Member Avatar for mKorbel
0
208
Member Avatar for ema-miles

I have a class project i am working on that is aimed at creating an airport weighing system. The program inputs the weight of the passenger and the weight of the luggage to be transported and computes the total to find whether a passenger is eligible to travel or not. …

Member Avatar for Ant695
0
400
Member Avatar for cabosun

I am having trouble figuring out how to read input from the keyboard and inserting that into a LinkedList. Any help or suggestions would be greatly appreciated. import java.util.*; import java.util.Scanner; import java.io.*; public class listlist{ public static void main(String [] args){ LinkedList ll = new LinkedList(); Scanner in = …

Member Avatar for stultuske
0
7K
Member Avatar for Vaibhav_5

Write a program in java for a user defined exception named as Illegal Age Exception. If the age entered by the user is less than 18 or greater than 60, then the program should raise a user defined exception which is explicitly handled by the code.

Member Avatar for stultuske
-1
134
Member Avatar for Wei_3

I run build.xml file in linux is fine but not in windows ant: build.xml:14 taskdef class net.sourceforge.cobertura.ant.InstrumentTask cannot be found using the class loader AntClassLoader [Path to my cobertura\cobertura-2.0.3-sources.jar]

Member Avatar for peter_budo
0
112
Member Avatar for fredy21

This is what I have in the main class: public static void main(String[] args) { final login login = new login(); login.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); login.setVisible(true); login.setResizable(false); login.btnEnter.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { login.inputText.getText(); new crosswordWindow().setVisible(true); login.dispose(); } }); } *there is a third class called login, where the jTextField is. The …

Member Avatar for Phaelax
0
174
Member Avatar for Search_not

I am currently busy working on an instant messenger program using the UDP `DatagramSocket` and `DatagramPacket` instead of the usual connection-based `Socket` and `ServerSocket`. I need the server-side of the application to check the online status of its clients. I have attempted doing this by connecting to the server using …

Member Avatar for Search_not
0
249
Member Avatar for Varunkrishna

How do I display the individual integers from the scanner input stream for example if the user enters 500 I would like to display it as 5, 0, 0. Here is the code guys import java.util.Scanner; public class Digit { public static void main(String[] args) { int number, i = …

Member Avatar for Varunkrishna
0
1K
Member Avatar for sameer.a.awan1

public void setState(String state) { if(state.length() <=3) this.state = state; else this.state = state.substring(0, 2); `}`

Member Avatar for Slavi
0
50
Member Avatar for TekknoDraykko

Hello All! I'm reviewing Java (SE, ver 8) and I'm using one of the "Teach Yourself Java..." books. I'm up to the chapter on Java Web Start and I'm stuck. I'm trying to run the sample app (a .jnlp file), but I get an error that reads: "Application Blocked by …

Member Avatar for TekknoDraykko
0
204
Member Avatar for jjones0150

Hello guys. Im having trouble figuring out why I keep getting an error saying the compier cant find my class. its all the way down at the end of the code called circle class. Any suggestions? package circle.pkg7.pkg2.app; import java.util.Scanner; /** * * @author Jay */ public class Circle { …

Member Avatar for stultuske
0
308
Member Avatar for sameer.a.awan1

import java.util.ArrayList; import java.util.Collections; public class PersonMaker { public static void main(String[] args) { ArrayList<Person> personAL = new ArrayList<Person>(); ArrayList<Address> addressList = new ArrayList<Address>(); Address c0 = new Address("2100 Pleasant Hill road", "duluth", "GA", "30096"); Address c1 = new Address("3392 fairway oaks", "lawrenceville", "Georgia", "30044"); Address c2 = new Address("4493 …

Member Avatar for stultuske
0
191
Member Avatar for Praveen_10

import java.util.ArrayList; import java.util.List; public class Task7 { static int count=0; String arr[]=new String[40]; /** * * @param list * @return an array consisting of vowels from the passed character array, * in the order they appear. for example, if list = {'t','h','e','s','a','u','r','u','s'}, * the method returns {'e','a','u','u'} */ public …

Member Avatar for JamesCherrill
0
144
Member Avatar for michael.james.90475

import java.awt.Frame; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.media.opengl.*; import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.glu.*; import com.sun.opengl.util.Animator; import com.sun.opengl.util.FPSAnimator; public class Object3D implements GLEventListener, KeyListener { GLProfile glp; GLCapabilities caps; GLCanvas canvas; GLU glu; float rotX = 0.0f; // Rotate screen on x axis float rotY = 0.0f; // …

0
134
Member Avatar for Wei_3

My build.xml can run junitTest well but when I tried to build with cobertura instrument, JunitTest failed, Why? <target name="instrument" depends="compile"> <echo> ====== run target instrument ==== </echo> <!-- Remove the coverage data file and any old instrumentation. --> <delete file="${junit.dir}/cobertura.ser" /> <delete dir="${instrumented.dir}" /> <!-- Instrument the application classes, …

Member Avatar for Wei_3
0
940
Member Avatar for anandhachandru

can anyone say best way to convert java class file into java file appreciate for your help thanks

Member Avatar for anandhachandru
0
614
Member Avatar for alemojarro

I am trying to make a code that makes a random point cloud that changes every five seconds for a minute. I have it so that it makes the inital cloud, but I am stuck on how to make it change every five seconds. private class newCloud implements ActionListener { …

Member Avatar for JamesCherrill
0
93
Member Avatar for Sudhakar_1

<head> <!-- //In header section of the page add below url code: --> <!-- Sesion time out and session expiry url starts here --> <s:url id="sessionExpirePopUp" action="sessionOutCiscoGSS" namespace=""> </s:url> <s:set name='sessionExpirePopUpNew' value='#sessionExpirePopUp.replace("&amp;","&")' /> <!-- Sesion time out and session expiry url starts here --> <script type="text/javascript" language="javascript" src="<%=request.getContextPath() %>/jsp/js/jquery.js"></script> <script …

Member Avatar for stultuske
0
203
Member Avatar for Sudhakar_1

Hi. The Timer displayed is 1 hr (HH:MM:SS) in decrement order. I have to display a pop out when 50 mints complete after that remaining 10 mints one pop up should display saying 10 mints with 0 sec. After that for every 2 mintues the pop up appear showing 2minutes …

Member Avatar for stultuske
0
102
Member Avatar for jjones0150

I'm having trouble working these last few kinks out my progarm. It would be greatly appreciated if you can help me out from here. import java.util.Date; import java.util.Scanner; import java.io.FileReader; import java.io.FileNotFoundException; import java.io.PrintWriter; import javax.swing.JOptionPane; import javax.swing.text.BadLocationException; public class aCircle { public double circumference(double cRadius) { return cRadius; } …

Member Avatar for stultuske
0
227
Member Avatar for Newbiejavagirl

I am a newcomer to java and jdbc. I am currently trying to develop a web application in which the user can upload a spreadsheet to the form. Is there any way in which contents of the uploaded spreadsheet can be saved to the database? I am working in eclipse …

Member Avatar for JamesCherrill
0
94
Member Avatar for Zubenna

Please I need a java expert to help me with the code and algorithm that deletes duplicate element from an array. I have written a programm to do this as shown below using my own algpritm. Though it is working but I think my code is too long for this …

Member Avatar for JamesCherrill
0
321

The End.