32,199 Topics
| |
hi all, im having this problem: i installed the eclipse in other computer besides mine, n it get the error that "there isnt a jdk installed", but there is. i tried uninstalling it n installing it again, but when i do that, the jdk fx starts installing it, when that … | |
Hi all, I am trying to write a code that determines the path of the currently running java file. I know that in python, you do os.path.join(sys.path[0], sys.argv[0]) in order to figure this out, but is there any equivalent code like this in java? Thanks! | |
import java.util.Scanner; public class AverageArray { public static void main(String[] args) { final int TOTAL_NUMBERS = 10; int[] numbers = new int[TOTAL_NUMBERS]; float sum; //Create a Scanner Scanner input = new Scanner(System.in); //Read all numbers for (int i = 0; i < numbers.length; i++) { System.out.print("Enter a number:"); //Conver String … | |
All these days I've been trying to access a Swing component (e.g.: JLabel) from a separate thread. I tried using "Thread", "Timer", "SwingWorker" but I couldn't find the solution. - Using a thread results in stack overflow. - Using a timer doesn't access the Swing component (e.g.: change the text … | |
I created 5 separate programs, and put them in the same folder; each one of them has a package. I need to create another one that calls their methods. The incomplete code that I have so far is: [CODE] import edu.macomb.itcs2590.babylonlion .cars.*; import edu.macomb.itcs2590.babylonlion .trucks.*; public class InventoryApp { public … | |
i don't know how to make it..but it is an assignment that must pass up on this sunday..can someone help me..its really important..it should applied array,object and classes...please help me...:( Suppose the weekly hours for all employees are stored in a two-dimensional array. Each row records an employee’s seven-day work … | |
I wish to create an application using swing to update data to the database. I will need three buttons add, modify and delete. i have so far created JDBC connection with Ms acess. i have also created a textfield where i will enter data like this... [code=JAVA] import java.awt.*; import … | |
Can anyone help me use a JLabel to display a stack??? I've been searching java.sun.com and I can't seem to find the right way to do it. I get errors every time. I think everything is right in my program besides this. Thanks for looking. Here's what I have: (Am … | |
So they forced me to take java despite having no programming background... I'm a web design major, not programming. Anyway, I'm really stuck on the homework problem - if anyone could help me out that would be amazing. I need to write a program (using a loops) so that the … | |
Help! Ok here is the goal of the program. The user inputs the stats of any number of players that they chose and my program needs to calculate the best and worst slugging percentage of the players and then display all the stats of those best and worst players. My … | |
hi guys i'm trying to get the sum, average, and the number of values in the array greater than the average... i am new to this and keep getting errors! helllpp.. [code=java]import java.util.Scanner; public class AverageArray { public static void main(String[] args) { final int TOTAL_NUMBERS = 10; int[] numbers … | |
hi, im making a static float method and i couldn't figure out the error i'm getting: invalid method declaration; return required Is there anyone can help with this static calcTaxes(float grossPay) { float netPay ; if (grossPay <= 300) netPay = (float) (grossPay - (grossPay * 0.15)); if (grossPay <= … | |
I'm new to JAVA and I can't seem to get this thing down I might be totally off. But I need to do a withdraw and deposit method any ideas?? [code=java]public class Account { private int id; private double balance; private double annualInterestRate; private double withdraw; private double deposit; private … | |
This is not running in Eclipse but ran in other jvm. Not sure if there is anything missing :( [CODE]import javax.swing.JOptionPane; import java.io.*; public class file1 { static int[][] number=new int[1000][1000];; static int row,column; public static void main(String[] args) { readFile(); /*for(int i=0;i<row;i++) for(int j=0;j<column;j++) System.out.println(number[i][j]); */ String result=""; for(int … | |
Hello! I'm a college student who is taking a beginners Java programming class. For the first time, I really need some assistance figuring out the latest assignment, which involves static methods. I have 5 such assignments, but I only need helping figuring out 1, because then I can do the … | |
I m making a bubble game in java applet and i have to face many problems in applets becoz i m beginner and i dont know how to use threads in java applets plz send me bubble game with source and pics | |
Is that possible to execute all the command available in cmd prompt by a java program? all that i know is there are .exe files corresponding to commands in windows>system32 folder, those are only executable by Runtime().exec command.what about other commands not having corresponding .exes?is it possible to pipe commands? … | |
Hey im quite new to java and my friends have been helping me out however ive stumbled upon a question im not quite sure how to solve. i need to find the max,min and avg of the total 'responses' im not quite sure how to bring the values from the … | |
I am a new student to Jaca Programming. I need help finding out where I am going wrong with my code. I am trying to have a user input 2 numbers and then have the input the calculation method of their choce. Add, subtact,multiply,divide. package javaapplication10; import java.util.Scanner; /** * … | |
Hi, I obtain the next error when I try debug the code and it is stoped. [QUOTE]ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820][/QUOTE] Can you help me, please? Thank you very much cordial greetings. stid | |
I made a game for my project. it contains two levels and a welcome screen. The problem is I cant go to the other panels. I tried using cardlayout. but since my panels are in different classes, I don't know how to do it. Please help. here's part of the … | |
hello guys, i have this code in java.but i need to convert to c.but i dont know java at all.hope u can help me.thanks for advance [CODE] public class Main { static int t_value=2; static int no_of_parameter = 0; String binary_setting; static int data[]; static ArrayList<String> constraint = new ArrayList<String>(); … | |
i would like to put the command Dos into java program. how i using the java to perform command function. for example, when we type ipconfig this command into command prompt, it will display my pc's ip right. so how i use java program when a user run my program … | |
[icode] import java.util.Scanner; import java.io.File; import java.util.StringTokenizer; import java.util.InputMismatchException; import java.io.FileNotFoundException; public class KashiwabaraNicole16test { /******************************************************************************* * Outputs integers from user input external files. ********************************************************************************/ public static void main( String[] commandlineArguments )throws NullPointerException { //Error Checking For Command Line Arguments.. if(commandlineArguments.length == 0){ System.out.println("Please enter the file name as the … | |
Hi, all How to create report use IReport and Hibernate I have tried, like this : : 1. create file hibernate.cfg.xml [code] xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.url">jdbc:mysql://localhost/a6</property> <property name="connection.username">root</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="connection.password"></property> <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> <!-- thread is … | |
I'm having a problem reading lines from a text file. The reading in itself works fine, but when the application has read 545 lines of text (545 .readLine()'s) I get a read error exception, for no reason at all as far as I can see. The code for the reading … | |
The code below captures the screen and saves it. Depending on your need, you can modify it to do just what you want [code] import java.awt.AWTException; import java.awt.Robot; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; class ScreenCapture { public static void main(String args[]) throws AWTException, IOException { … | |
Hie guys, Iam developing a java web application which uses mysql as its database engine. Now I would like to use the hibernate and spring frameworks together. The problem I nam facing is in configuring the various beans and establishing a clear relationship btwn the two frame works. If any … | |
Hello! I'm writing a fractal generation application. I have the fractal part down, but I can't seem to get the coloring right. What I want to do is, as the number gets closer to infinity, the pixel it relates to's color should get darker (Black relating to infinity, The other … | |
In my application an error massage comes when the required data fields are not filled. I did it as, [CODE] if(component.getSelectedItem().equals("")|description.getText().toString().equals("")){ JOptionPane.showMessageDialog(null,"Please insert required details \n ","Error",JOptionPane.ERROR_MESSAGE); } [/CODE] the problem: When I click "OK" when this massage pops up, it closes the entire window. How can I avoid it. … |
The End.