32,207 Topics
![]() | |
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? | |
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 … | |
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 … | |
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 = … | |
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 … | |
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: … | |
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 … | |
Hi, Myself need code for file transfer among three different machines using socket programming in java. | |
Can any one helps me in getting the code for hub finder algorithms and hub rank | |
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 | |
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 … | |
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) … | |
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 … | |
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 … | |
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! | |
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 … | |
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", … | |
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]; … | |
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 … | |
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 … | |
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" ); … | |
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 … | |
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 … | |
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 … | |
i saw the operator <> first time, tell me in detail the use of this ? | |
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] | |
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"); ^ … | |
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) … | |
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 … | |
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 … |
The End.