32,199 Topics

Member Avatar for
Member Avatar for s080072

I have to write a program that asks the user to input a positive integer. It should than output a message indicating whether the number is a prime number.

Member Avatar for javaAddict
0
91
Member Avatar for aznnytezx

[code] import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Random; public class snake1 { public static void main(String args[]) { String name1= JOptionPane.showInputDialog("Enter Player one's name"); Windows myW=new Windows(name1); myW.setSize(800,600); myW.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { System.exit(0); } }); myW.show(); while(true) { myW.repaint(); try{Thread.sleep(60/myW.getLevel());}catch(Exception e){} } } …

0
54
Member Avatar for Teckiwi

This is for an assignment, I'm not asking for answer answers/code to help me out but a point in the right direction would help me greatly. I have approximately 250 lines of data (olypics data) that I want to load into a constructor and then make an array of said …

Member Avatar for Teckiwi
0
111
Member Avatar for ceyesuma

I am adding functionality to a tutorial which is a JDesktopApplication(Netbeans6.1)using Entity class from databases with Persistence unit and entitymanager. I have components in place. Can someone help me find out if there is a bean that fires the actionperformed methods? Ican't figure out were it is. I need to …

Member Avatar for ceyesuma
0
68
Member Avatar for hellotreasure

I'm looking for a javadoc script that would automatically generate a javadoc website and update the SVN with it, but I can't find one anywhere, so does anyone know where I can get one? A simple script that runs javadoc would do just as well, because from what I understand, …

Member Avatar for hellotreasure
0
78
Member Avatar for Relegant

[COLOR="Green"]This case, [/COLOR] [CODE]case 18302: if (playerLevel[19] <= 1) { guard(); addSkillXP(19, 50); isNpc = true; updateRequired = true; appearanceUpdateRequired = true; else if (playerLevel[19] >= 1) { sendMessage("You need a shapeshifting level of 1 to do this."); } break;[/CODE] [COLOR="Green"]I made it by myself, and it gives 100 errors, …

Member Avatar for VernonDozier
0
93
Member Avatar for peter_budo

I have some webspace that I used so far for university assegnments. I would like to to convert it to blog website where I will place some rants, codes and some maybe for somebody interesting info that I find along the research path of my MSc project. Website will be …

Member Avatar for jwenting
0
80
Member Avatar for Alistair1

Ok well apart from a little inconvenience, my program runs almost flawlessly given the guidelines of the assignment. I'll tell my problem first and right after paste my code: When you type in the sentence to be analyzed, only the punctuation mark at the very end doesn't get counted towards …

Member Avatar for Alistair1
0
105
Member Avatar for K?!

Hello I'd like to create a hover effect for JButtons, but i can't find it for the moment. It doesn't have to be antything spectacular, it just has to be visible. Thanks in advance. Greets, K?!.

Member Avatar for K?!
0
9K
Member Avatar for alpe gulay

I made a simple program in which will connect to ms sql... then, after running the codes something is error! can you help me to solve this out... here is my code: import java.sql.*; public class connect_sql { public static void main(String args[]) { Connection con = null; try { …

Member Avatar for alpe gulay
0
141
Member Avatar for ebebcb

I'm trying to write a program that first decides if a number is prime, and if it is writes it to a file I created. I'm obviously having problems (or I wouldn't be pulling my hair out and posting this). First, the errors say an identifier expected after the "public …

Member Avatar for javaAddict
0
72
Member Avatar for eec322

I'm suppose to create a problem that displays the contents of a file (that the user inputs), and then displays each line with a number in front and a colon after it. So, line 1 and 2 would print out: 1 lineFromFile : 2 lineFromFile : But, it keeps printing …

Member Avatar for alpe gulay
0
171
Member Avatar for luxmi_gee

hi i received one error when i run jsp page with custom control.the error is cannot find setter method for the attribute <attribute name> of the tag handler <tag handler name> my pgm is. private String dfontSize="12"; public void setDfontSize(String dfontSize) { this.dfontSize = dfontSize; } out.print("<SPAN STYLE=\"" + "font-size: …

0
76
Member Avatar for geisteskrankhei

Basically, I have to make a code that requests user input. The program asks them to tell me how many columns/rows the user wants the magic square to have. I need to then generate random numbers for each spot. ex: user inputs 3, out put looks like 3 7 1 …

Member Avatar for Ezzaral
0
177
Member Avatar for himanjim

[B][I]I've designed a simple applet that works fine on My Windows Xp but when I upload it on my webhost server or run it through any server for e.g. Tomcat It shows the following error in Java Console but no error without server [/I][/B] [B]Java Plug-in 1.6.0_02 Using JRE version …

Member Avatar for jasimp
0
110
Member Avatar for Barman007

Im hoping this is just simple, but I have a main class for my GUI and I do some printing in another class called board, which gets its information from my peg class, which gets its information from my linked list. Is there and easy way to print my pegs …

Member Avatar for Ezzaral
0
182
Member Avatar for fj822

Hello, i am new java beginner and have some problems when i try to add "ListeningPoint" in mye class. I got some error massege like this, but can not fix it: <identifier> expected [javac] myListeningPoint = sipStack.createListeningPoint(port, "udp"); [javac] ^ [javac] 1 error can you please help me ?? Here …

Member Avatar for fj822
0
145
Member Avatar for warjas816

I wrote the following code, and it seems to be working well up until the end. I do not get any error messages, but the last method has 5 lines that are supposed to print out. Nothing prints. Any ideas? Hints? Clues? Thanks! public class paintJobEstimator { public static void …

Member Avatar for warjas816
0
118
Member Avatar for Barman007

Now this is an assignment for me, but ive spent the last two weeks writing this code day and night, I just cant get it out of my head, I have to beat it lol. So anyway, two days ago I won and completed my program exactly the way I …

Member Avatar for Barman007
0
92
Member Avatar for NycNessyness

Hello. I now know how to allow the user to enter only numeric input in a FormattedTextField. What I need help with now is how to allow the user to only input letters. An example is what I have below. The problem I keep getting is it won't allow me …

0
86
Member Avatar for jessen

Just got one more question. I tested in my java JMF program just now. I found that AVI format are not supported by JMF. and also wmv,wma; who can help me? thank you!!!

Member Avatar for jessen
0
125
Member Avatar for ceyesuma

[code] String like=searchJTextField1.getText(); query=entityManager.createQuery("SELECT c FROM content c WHERE c.artist LIKE \"%" + like + "%\""); query.setParameter(like, searchJTextField1.getText()); [/code] is there someone that could tell me if this code is right? thanks -Steve

0
65
Member Avatar for pavelkoo

I have a very specific question. For one particular handset I'm using, playing a http stream, each time the player closes, there is a considerable delay i.e. 2 seconds, this is unacceptable as the music is not smooth. Does anyone one know of a way to improve the efficiency of …

0
64
Member Avatar for ceyesuma

If netbeans ide has a queryproperty set to SELECT c FROM Content c How can I change this query to say ..limit the resultset to less records like 10 or 20 instead of the whole database. I am not sure what that SQL string would look like.

Member Avatar for ceyesuma
0
104
Member Avatar for ceyesuma

Do you have some understanding of the netbeans6.0 concerning binding and queries? I have a jdesktop program from a tutorial using the netbeans ide. it automaticlally sets the query property to [icode]SELECT c FROM Content c[/icode] (which is somewhat foreign to me) however; I'd like to have another example of …

0
51
Member Avatar for NickMalone85

I'm just playing around with some code and I can't figure out why this isn't working. It's only "encrypting" one word. Can anyone tell me what's wrong with it? [code = java] import java.util.*; public class EncrypterDriver { static String encrypt(String fileMessage) { String encryptedMessage = ""; char fileChar = …

Member Avatar for Ezzaral
0
92
Member Avatar for bduitp

Hi, I hope this is the right place to post this topic. I'm building an imagealbum application. Registred users can visit certain parts of the album after authentication. So, the usermanagement and authentication process are build as servlets in Tomcat using a jdbcrealm. As the images are uploaded directly thru …

0
48
Member Avatar for chickenchaser

im designing a 12 hour clock, converting it from a 24 hour clock. i had the idea of keeping the clock internally as 24 hours, and externally showing it as a 12 hour clock. The code I have is public String getTime() { if (hours.getValue() >12) { hours.setValue(hours.getValue() - 12); …

Member Avatar for Ezzaral
0
111
Member Avatar for sid99

Hi, I am quite new to regular expression and I am kinda stuck on this question. I am using a book which explains it only in short detail. I have an answer but am not sure if I got it right. If someone can please check it and post the …

Member Avatar for sid99
0
83
Member Avatar for Karkalash

Hi: I have to write a program that uses methods and arrays. I have to create a method that creates an array and populates it with 10 random numbers between 1 and 10 inclusive. Then I have to write another method that sorts the number from lowest to highest and …

Member Avatar for Karkalash
0
137

The End.