35,618 Topics
![]() | |
The first block is all of my methods and stuff and the second block is just the driver. i'm trying to get it to ask the user if it wants to repeat the whole thing again, but it only works with the last 2 choices [CODE]import java.util.*; public class methodsForTest … | |
Hello all, I'm creating a login application using swing but ive run into problems already, I need help on making the if else statement work so the background is red. Your help is very much appreciated, [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; class MyWindowListener extends WindowAdapter { public void windowClosing(WindowEvent … | |
Hi all, Im getting the folllowing error for the attached applet code when i try to view it through windows explorer: java.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read) 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.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at AppletTest.init(AppletTest.java:26) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) … | |
![]() | My problem is that when i play a game on messenger(eg. chess), my cpu is 100% and my computer is responding hard. What can i do to lower my cpu usage ? I have windows Xp service pack 2, and using java 6 , update 22. My Pc has 1 … |
Hi Guys, I'm basicly reading from a CSV File that im using to store data. Now when I read from the CSV file i want to load the data to fill in the parameters eg. the csv file contains name,address,age,favColor. so when i load the file i want it to … | |
It just won't. No matter what I try, it won't even output what I tell it to, muchless as me for input. Here's the code: [CODE]package javatask1; import static java.lang.System.out; import java.util.Scanner; public class Main { public static void main(String[] args) { public static int moneyEarned = 0; Scanner myScanner … | |
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 … | |
dear friends plz ask me website list which contain ready jsp project for download. plz answer me fast its so urgent plz thanks in ADVANCE............(happy new year in ADVANCE alsoooooooo) D.M.Y.K.(dua mei yaad rakhna) | |
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 … |
The End.