35,618 Topics
![]() | |
Hi there, I'm getting an error saying: non-static variable MainList cannot be referenced from a static context. My snippet of code where the error is occuring: [CODE] //this method is in a class called ViewContact public void printInfo(){ int index = MainScreen.MainList.getSelectedIndex(); } [/CODE] Now the List "MainList" is in … | |
Been asked to write a program using Cream library. We have to used Constraints, but i have no idea what they are Could someone give an explanation of one and possibly some examples? | |
Hello people, I decided to make a family tree as a graduation project, I've thought about multiple ways to make it, but I like some fresh ideas, in case i forgot some things. I'm trying to keep the project as easy as possible, because in the end I will need … | |
hello sir m find a apache poi jar file what m confuse where to put this jar file so plz help me nd send a mail me procedure of use a poi jar file set class path and other details. plz send me on my mail id <snip> | |
Hi all, I want to sent an email to user using Jav Mail API. But the email is sent without any authentication.. Can I do this? Please give the examples or Help me.. Thanks in Advance .. Myl | |
i wrote a program that calculates how many coins that a vending machine splits out and such, and it does work but i can't figure how it works. at the time, i was sure of the logic, but now i can't understand how this is possible. [CODE] change = (amountPaid … | |
Hi Dear Danimates, I have developed one tool with the help of Swing components. Is there any possibility to convert that application into JSP.. Bcz i need that application to be in the form of Struts. So help me..... | |
[CODE]public static String strCap(String str){ //capitalizes the first letter of the string String newStr1 = str.replace(str.charAt(0), Character.toUpperCase(str.charAt(0))); int position = str.indexOf(". "); // looks for a period followed by a space while(position != -1){ newStr1 = newStr1.replace(newStr1.charAt(position + 2), Character.toUpperCase(newStr1.charAt(position + 2))); position = str.indexOf(". ", position+1); } return newStr1; … | |
I am new in java swing and I created a frame... i checked the documentation API and it has this "setSize()" method.. so yeah i did set the size of my frame but everytime i run the program, it is not on the size that i have specified [CODE] public … | |
i have a Jframe.in order to paint it i not using paintComponent but ordinary function containing g.drawstring("sd",0,0). when ever i click the mouse the string should appear at that point and it should move with the cursor until another click appears. my problem after clicking the string is not appearing … | |
Hey everyone, Im working on a few java programs for a class and this one i can't seem to find an answer anywhere for. I need to write a program that roll's a dice, which is simple, then i have to have it roll the dice 20 times. Also simple. … | |
Hey guys I need help with part 2 of my space invaders game. So far I have the missile shooting from the base but the missile is only fired once and that's it. I need to finish the code so that once the missile hits the top of the window … | |
Hi, I have a program that has a package that is imported in a class called Control.All the files are compiling correctly apart from when I try to import a package. I am importing the package by [CODE]package carpkg;[/CODE] and in my main there is [CODE]GUI gui = new GUI[/CODE] … | |
So there's this old programming assignment from last semester and he's giving extra credit if we finish it. Here's the assignment [url]http://www.cs.oswego.edu/~odendahl/coursework/csc212/201009/assignments/04.html[/url] I really want to finish this but it's the first time my class is trying to do it without pseudo code. Here's what I have so far for … | |
Not so new anymore more with Java but as it gets more advanced (for me that at least) the tricks evade me. I would like to output sorted values into my GUI but two things are not happening. 1. Cannot get values to print in GUI but prints on screen … | |
When I compile this program it says "cannot find symbol class Method Master", but when I run it, everything is fine. [CODE] /* *Andrew Davis *Nov. 19, 2010 */ import java.util.Scanner; public class Calculator { public static void main (String [] args) { Scanner keyboard = new Scanner(System.in); MethodMaster method … | |
In class my teacher ran a program similar to this one. When I attempt to run this from home I get a message saying "No main classes found". I know there should be a main in the program but he ran a similar program without it. Just trying to get … | |
hello people... simple doubt [CODE] class test { public static long testApp(long number) { return number; } }[/CODE] when i pass "45638" it returns perfectly but when i pass "23837472"; it's returning not in the range. what's the issue as long has very big value/range.. and how do i pass … | |
I am confused on how to get my x and y coodrdinates to overalap. Can you please help me or give me an example of how to do so. This is the code that I have so far: [code] public boolean hitBy = true; public boolean hitBy(Bullet b) { // … | |
Hello, im having some trouble with my java assignment. The Q: [I]Write a program which will test that a dice is random, i.e. that it is equally likely that any number will appear. E.G The program simulates throwing the dice 6,000 times. The one appears 1003 times, the two, 996 … | |
gedit uses UTF encoding. Therefore, if we store binary data in the file (like through DataOutputStream's writeInt() or writeByte(), etc.), gedit would rightly complain, but if we write something through the writeUTF() function, then gedit should be able to open it as the data is written is UTF which it … | |
Using a BufferedInputStream is useful because it cuts down on read system calls. But the same effect can be produced, say in reading a file, if we use FileInputStream's read method that takes a byte array as input. A lot of bytes are read in a single call. Am I … | |
Hi I,ve just started using the spring roo framework,and tried running the vote.roo sample project numerous times but each time i run mvn test in the root of the project i get this error vote.roo project failed to execute goal on project vote:could note resolve dependecies for project com.springsource.vote:vote:war:0.1.0.BUILD-SNAPSHOT I,ve … | |
Am having bit of writiers block about how to fix this error. Its a assignment for college so am really just looking for tip or pointer in right direction. Its a simple card game similar to poker. Card.java [CODE] package pokerpkg; public class Card { //Codes for the suits public … | |
[CODE]public class examination extends javax.swing.JFrame { public Connection con; public Statement stmt; public ResultSet rs; public String sname,sid,sub; /** Creates new form examination */ public examination() { welcome wl=new welcome(); String stname=wl.regdno.getSelectedText(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:exam"); Statement stmt=con.createStatement(); ResultSet rs=stmt.executeQuery("SELECT * FROM student where sno='"+stname+"'"); while(rs.next()) { sid=rs.getString(1); sname=rs.getString(2); } … | |
Hi guys! I need help here, When ever I write onto my text file, i get null and then the value.Please help me! I don't want the "null"! Here is how it looks like in Notepad++: null1: 0.22056311934213296 2: 3.017771771149946 null3: 1.508399104807777 4: 0.07575171145562612 null5: 5.187081012091999 6: 2.049001095182013 null null … | |
Hi all I'm new to JMS, im setting up a pilot project, and I'm making use of this tutorial - [url]http://javadude.wordpress.com/2009/01/03/tutorial-starting-with-glassfish-and-jms/[/url] The tutorial is for Glassfish version 2 and JEE version 5, but im using Glassfish version 3, and JEE version 6 now when i try to deploy the project … | |
HI I am working on a project to animate user-defined algos. I am still at the very beginning but I am practicing code in swing and here is an Array class that the user can use in his user defined algo: [CODE] import java.awt.*; import javax.swing.*; public class Array1 extends … | |
Hello friends, I have a problem about JLabel I want to insert a data from database into my JLebel.setText() method.Please help me | |
Hello! I'm trying to solve this problem and I've been at it for hours. [I]Write a method called handScore that takes an array of cards as an argument and that adds up (and returns) the total score. You should assume that the ranks of the cards are encoded according to … |
The End.