32,207 Topics

Member Avatar for
Member Avatar for erogol

I divided 13/24 in java but the result value is printed as 0.0; the variables like; int asd = 13; int dfg = 24; double result = (double)(asd / dfg); print(result); // 0.00 How can I get the exact value?

Member Avatar for sincerelibran
0
103
Member Avatar for thalz

I am new to java and i want to use this programming language for our final project. Pls help me configure lynksys wrt54g using java app. Its unique feature is to limit the time of the registered user to use the internet and it will automatically cut off if the …

Member Avatar for Slimmy
0
339
Member Avatar for hauda67

I was wandering if I could get some help in refining my code for the following problem: "Write a java program that declares an array alpha of 50 elements of type double. Initialise the array so that the first 25 elements are equal to the square of the index variable …

Member Avatar for hauda67
0
163
Member Avatar for vallikasturi

Hi, I need to connect to ftp and get the names of the files... But am getting an UnknownHostException when i gave the ip.. Following is my code [CODE]import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.io.FileUtils; import java.io.IOException; public class FtpTest { public static void main(String[] args) { try{ FTPClient client = …

Member Avatar for masijade
0
568
Member Avatar for abc.forforum

Hi all, I added -Djava.library.path="C:\Documents and Settings\users" in properties of my project and my application works fine, i created a jar and run with java -Djava.library.path=C:\Documents and Settings\users"-jar Host.jar it worked fine but when we double click Jar it only runs with "java -jar host.jar".So i want to add this …

Member Avatar for ~s.o.s~
0
160
Member Avatar for nitins60

hello people, I am checking the string pool and its basic operation i.e. how it works [CODE] public class Test { public static void main(String[] args) { String s1 = new String("abc"); String s2 = "abc"; String s3 = s2; System.out.println("Hash Table: "); System.out.println(s1.hashCode()+ " "+ s2.hashCode()+" "+s3.hashCode()); System.out.println("== Check: …

Member Avatar for ~s.o.s~
0
142
Member Avatar for Swiftle

Hello, I have an assignment for a multi thread bubble sort written in Java. It may not sound very hard but we only had 4 hours of introduction and never wrote a single line in Java before getting this. But this isn't the point :P. I have problems with what …

Member Avatar for Swiftle
0
124
Member Avatar for viswacse

Hi, Myself need code for file transfer among three different machines using socket programming in java.

-1
44
Member Avatar for rahulKRISHNAN

Can any one helps me in getting the code for hub finder algorithms and hub rank

0
40
Member Avatar for pradeepsimhanp

Hi, I have a doubt that why string is immutable in c#/java? why not that case with primitive types such as int,float etc..? can you please let me know what the reason behind this design? Thanks, Pradeep

Member Avatar for kvprajapati
0
199
Member Avatar for anony

Hello everyone I was just wondering how these online train ticket booking sites in particular work. Do they link to other sites to check the availability of seats?? I am talking about private travel agency websites as i came across some online train ticket booking site which had bus, flight …

0
71
Member Avatar for JellyTurf

this is my java code that i'm experimenting with right now. trying to learn graphics. [CODE]import java.applet.*; import java.awt.*; public class game extends Applet { Image dbz; public void init() { Font newFont = new Font("TimesRoman", Font.BOLD + Font.ITALIC, 50); setFont(newFont); dbz = getImage(getCodeBase(), "dbz.jpeg"); } public void paint(Graphics g) …

Member Avatar for ProgrammerAl
0
264
Member Avatar for samccarn

Hey, I'm making a maze game, where the user is a picture I've got, and they have to move the picture using the arrow keys to get to the end of the maze. How do i make a picture into a character like that? Also, how do I assign the …

Member Avatar for packetpirate
0
79
Member Avatar for serph09

1) Is this right? In java.awt there is a class named Point which represents a point in 2-D space. It has methods getX() and getY(). Below is the definition of a Points class which has a Point[] array as an instance variable. You are to write a method getMaxX() that …

Member Avatar for Slimmy
0
109
Member Avatar for LianaN

Hi! I would like to make a JFrame that will play a role of a toolbar. It can be dragged and dropped within a specified area. So, I don't know how to specify the area for dragging and dropping. Could anybody help me? Thanks!

Member Avatar for LianaN
0
99
Member Avatar for ll_jesse_ll

Hey guys I was hoping someone could help me here. I had to make a Tetris game using eclipse for my intro to Java programming class. I got it all done, but i would like to play the game without having to run it through eclipse. For example if i …

Member Avatar for ll_jesse_ll
0
118
Member Avatar for baldwindc

I'm looking for a starting point on this. Can someone point me in the right direction? I want to allow a user to create a new class object that will just store data. My class is data and my type is "flight" so: [code=java] Data flight1 = new Data("A string", …

Member Avatar for baldwindc
0
356
Member Avatar for Roy1287

Quick question From main thread [CODE]double[] ascore; int i; imax=high.highestScore(ascore[],i); [/CODE] From method highestScore [CODE] public class highestScore { // This method checks which number is higher. public static double highestScore(double[] score,int arraySize) { int index; double maxScore=0; for (index=0; index<arraySize; index++) { if (maxScore < score [index]) maxScore= score[index]; …

Member Avatar for Roy1287
0
129
Member Avatar for Slyvr

I'm fairly new to java, but I'm sure I've done this before and now it's not working right. What am I forgetting here? LeftPanel class [CODE]Inventory inventory; JTextField txtMoney = new JFormattedTextField([COLOR="Red"]inventory.getInvWallet()[/COLOR]);[/CODE] Inventory class [CODE] public class Inventory { public int invId = 0; public int invPrice = 0; public …

Member Avatar for Slyvr
0
103
Member Avatar for nickelsunshine

I am at the end of my quarter and have two programs to write and need help. I dont even know where to begin. I have decided to change my major to something else, but I dont want to fail this class and hurt my GPA. I have a programming …

Member Avatar for cale.macdonald
0
460
Member Avatar for Snoozey

I keep getting this error on my else. Anyone have any ideas? I don't quit understand this error as the the if works just fine, and it is same thing. it just sends it to a different array. [code] catch ( NoSuchElementException e ) //Error { System.err.println( "Invalid input62" ); …

Member Avatar for Snoozey
0
138
Member Avatar for Dean_Grobler

Helew! I just wana know if someone might have an idea of how I can go about doing this: So attached I have a little example I whiped up. Say you have 3 buttons, button1, button2, button3. What I wana do, is when you click [B]button1[/B], it will magicly turn …

Member Avatar for javaAddict
0
112
Member Avatar for Lazairus

Hello This is my first post, could you help me on this point, I have a jscroll pane. the problem is I want to move an icon image that is attached to jpanel. frame > jpanel > image> frame > jscrollpane. Goal : move image on the Jpanel. Is this …

Member Avatar for quuba
0
84
Member Avatar for Ron2794

why the following things cannot be : 1.why i cannot extend the non static variable from static method or something ? 2.why i cannot use a variable directly in the class as : [ICODE] class abc{ int i=4; } class xyz extends abc{ int j=7; i=9; /*this should be valid …

Member Avatar for masijade
0
156
Member Avatar for Ron2794
Member Avatar for masijade
0
90
Member Avatar for Transcendent

I don't know how to call this method to another program. [CODE]public class ForLoopTest { public static void main ( String [] args) { int product = 1; for ( int i = 1; i <= 10; i++ ) { product *= i; } System.out.printf(" %d ", product); } }[/CODE]

Member Avatar for jon.kiparsky
0
126
Member Avatar for nickelsunshine

Can anyone help! have 12 hours before must turn in this project and still getting errors, but got htem down to one. Here it is: F:\CPT244\Programs\Tests\Chapter 13 & 14 Test\Lab 1\FlightListMain.java:54: cannot find symbol symbol : constructor Flight(java.lang.String,java.lang.String) location: class Flight Flight target = new Flight("Detroit, MI", "Miami, FL"); ^ …

Member Avatar for seanbp
0
130
Member Avatar for oggiemc

Hi all, Im getting the following error when i try running the attached applet: java.security.AccessControlException: access denied (java.net.SocketPermission localhost:8080 connect,resolve) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkConnect(Unknown Source) at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source) at sun.net.[url]www.http.HttpClient.openServer(Unknown[/url] Source) at sun.net.www.http.HttpClient.<init>(Unknown Source) at sun.net.[url]www.http.HttpClient.New(Unknown[/url] Source) at sun.net.[url]www.http.HttpClient.New(Unknown[/url] Source) at sun.net.[url]www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown[/url] Source) …

Member Avatar for seanbp
0
252
Member Avatar for Oblivious21

Hey guys i have a weird problem but its probably something small. i have a hang man program that has no errors. i am using netbeans to compile my project but when i run it it nothing come up or prints out. i don't know what im doing wrong because …

Member Avatar for Oblivious21
0
196
Member Avatar for ProgrammerAl

I can't come up with logic for certain actionListeners for my program, mainly the ones that will run the game. I want to go through my actionListeners one by one. First actionListener I want to work with is the one that will be setting the order of pictures that the …

Member Avatar for ProgrammerAl
0
87

The End.