35,618 Topics

Member Avatar for
Member Avatar for Dean_Grobler

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 …

Member Avatar for JamesCherrill
0
127
Member Avatar for XxPKMNxX

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?

Member Avatar for XxPKMNxX
0
84
Member Avatar for mindbend

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 …

0
151
Member Avatar for Ronik

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>

Member Avatar for peter_budo
0
80
Member Avatar for Mylsamy

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

0
79
Member Avatar for plasticfood

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 …

Member Avatar for masijade
0
156
Member Avatar for techieinvents

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.....

Member Avatar for masijade
0
60
Member Avatar for plasticfood

[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; …

Member Avatar for kola.naresh
0
92
Member Avatar for it2051229

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 …

Member Avatar for rincethomas33
0
160
Member Avatar for jbalaji87

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 …

Member Avatar for jbalaji87
0
102
Member Avatar for agons

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. …

Member Avatar for polk230
0
2K
Member Avatar for coco24

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 …

Member Avatar for trogador
0
239
Member Avatar for StaticX

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] …

Member Avatar for Gerbiler
0
151
Member Avatar for jamesze

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 …

Member Avatar for apines
0
181
Member Avatar for jems5

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 …

Member Avatar for jems5
0
464
Member Avatar for Andrew Davis 64

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 …

Member Avatar for Andrew Davis 64
0
209
Member Avatar for Alkaline8214

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 …

Member Avatar for Alkaline8214
0
219
Member Avatar for nitins60

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 …

Member Avatar for nitins60
0
10K
Member Avatar for coco24

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) { // …

Member Avatar for Gerbiler
0
73
Member Avatar for Goyle

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 …

Member Avatar for apines
0
139
Member Avatar for daudiam

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 …

Member Avatar for daudiam
0
136
Member Avatar for daudiam

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 …

Member Avatar for daudiam
0
250
Member Avatar for mmnewbee

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 …

0
50
Member Avatar for hannon565

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 …

Member Avatar for quuba
0
204
Member Avatar for subrat_p

[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); } …

Member Avatar for javaAddict
0
323
Member Avatar for hazeeel

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 …

Member Avatar for hazeeel
0
4K
Member Avatar for mementomori

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 …

Member Avatar for ~s.o.s~
0
286
Member Avatar for DARK_BYTE

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 …

Member Avatar for DARK_BYTE
0
228
Member Avatar for subrat_p

Hello friends, I have a problem about JLabel I want to insert a data from database into my JLebel.setText() method.Please help me

Member Avatar for javaAddict
0
65
Member Avatar for Yutxz

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 …

Member Avatar for apines
0
251

The End.