137 Posted Topics

Member Avatar for lardshow
Member Avatar for JamesCherrill
0
109
Member Avatar for shatha14

you should be more specific on mistakes. does it compile? is your action performed working? i notice your panel doesnt implement action listener, your frame does. the button is on the panel. Mike

Member Avatar for adams161
-1
181
Member Avatar for selenask

edited thought you didnt have a panel i see you do. I havent used your method of nesting main within the frame class and creating a frame within the frame class. maybe someone can comment if there are any issues there.

Member Avatar for adams161
0
144
Member Avatar for adams161

Hi, when i run my java program it has that little java coffee cup image in teh task bar. All my apps have this. i guess its default. How do you set that to something custom? i cant seem to come up with teh proper name for what that image …

Member Avatar for adams161
0
82
Member Avatar for Sodabread

All the points on cloud computing are good and I think i'm in agreement with what I see as the two main points: one- you don't own your data, and two- you lose internet and your employees are on vacation. But i want to make a point on a different …

Member Avatar for Seten
1
209
Member Avatar for adams161

I have a gameboard class: class gameboard extends JInternalFrame In the constructor i have the line: setDefaultCloseOperation(DISPOSE_ON_CLOSE); my gameboards are actually in an array myboards[500] were each is an object of this class. the deal is I want to be able to tell which are open and i want to …

Member Avatar for adams161
0
102
Member Avatar for Bobon

two things. one you are hard coding lastDay[11], you may know this and its for debugging. the second is you are setting valid twice. First you set valid to true or false on the day issue. But then you set it again wiping out any previous answer it had on …

Member Avatar for Bobon
1
190
Member Avatar for serra01

i was amused that you called it Peception of c++ when it sounds like you meant perception, with an r. Now this type of party foul wouldnt normally phase me much but then i started reading the post and the mismatch between your convoluted hard to read language and the …

Member Avatar for adams161
-9
293
Member Avatar for adams161

I have a chat window, JTextBox i think, and you hit enter and it invokes an action listener, to send text. It generally works, but now and then i hit enter, and nothing. I have to hit enter again and typically it sends text. the focus is there for typing, …

Member Avatar for adams161
0
103
Member Avatar for adams161

I got a basic telnet socket connection working in an applet. YOu can log onto a server and type and read text. My issue is to show the servers chat i'm using a JTextArea. now this may be the best to use i dont know, maybe i just need to …

Member Avatar for adams161
0
141
Member Avatar for shani1986rox

[code] int b=value.length(); for (int i=0;i<=b;i++) { if (value.charAt(i)==' ') maxSize +=1; [/code] I didnt have time to look at all your code but noticed something at the top. your going to <=length in your loop here. String c= "cat"; has stringlength 3. but charAt() will only work on spots …

Member Avatar for adams161
0
117
Member Avatar for adams161

Hi, I was playing around last night with having one main frame that contains several windows you can open under the window menu. For example you might have a chat window and you might have a game board window. I want these windows contained by one larger frame that represents …

Member Avatar for adams161
0
119
Member Avatar for emmas4impact

i googled and found this link. developer.android.com with any of these phones you have to download their SDK. They use a java like language if they are java compatible but are not exactly java as we know it from sun. I had limited experience doing this with the LG phone …

Member Avatar for emmas4impact
0
233
Member Avatar for JBeginer7891

yea sounds like you are at no data. this below isn't by chance suppose to be "patientNo" ? [code] v.addElement(rs.getString("patienNo")); [/code]

Member Avatar for JBeginer7891
0
187
Member Avatar for Teethous

Take a look at the java page on FileReader() which lists 3 possible constructors. [url]http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileReader.html[/url] I do not see a constructor that can be used without passing a parameter to the constructor. i.e i don't see new FileReader(); maybe this constructor they list there would work: FileReader(String fileName) Creates a …

Member Avatar for BestJewSinceJC
0
118
Member Avatar for Iz3k34l

google an ActionListener. Your class that has the listener has to implement ActionListener, ( capitalization on that?). i.e. class mypanel extends JPanel implements ActionListener (above is from memory , check spelling syntax but i think that works) when you extend you are using inheritance, you can only extend from one …

Member Avatar for Phaelax
0
148
Member Avatar for Egypt Pharaoh

one of the things you can drop onto a form ( like you drop a text box) is a timer. You would also need to create an action listener for your timer. i'm not sure on details of adding controls on the fly to a form, but you should easily …

Member Avatar for sknake
0
112
Member Avatar for m-e-g-a-z

when you start coding it maybe ask more specific questions about arrays etc. i have looked into how to solve mastermind, wikipedia has some methods ( one or two not sure) on how to through an algorithm to solve mastermind. google wikipedia mastermind maybe. Another possiblity is ( i dont …

Member Avatar for adams161
0
94
Member Avatar for JasonDoyle

I'm curious myself about the answer. His title says this is an Applet. So the problem is how to save info from session so session since i believe java applets cant write to local files. Would it be possible to save info server side? How would you identify that a …

Member Avatar for adams161
0
146
Member Avatar for GiRL,IT

try this page for a java tutorial: [url]http://java.sun.com/docs/books/tutorial/[/url] It sounds like this is a class assignment. Is there a textbook you can look at? Mike

Member Avatar for GiRL,IT
-2
156
Member Avatar for amishraa

[QUOTE=amishraa;1072250]So I have calculated the total of students on all of their 6 grades but now I want to be able to calculate the average of all the grades and list the averages next to the total column. Any help would be greatly appreciated! [CODE] //preprocessor directive #include<iostream> #include<iomanip> #include<fstream> …

Member Avatar for cibaiciao
0
394
Member Avatar for 2scoopdelux

I'm not clear what the issue is, just that there are problems. I did notice you said you couldn't use if statements with strings. Maybe this could help. [code] // you have a string dogtype if(dogtype.equals("large")) size = 3; if(dogtype.equals.("medium")) size = 2; if(dogtype.equals.("small")) size = 1; [/code] StringName.equals("matching text") …

Member Avatar for 2scoopdelux
0
190
Member Avatar for Kriogenic

you are checking if it contains that string on every line you read. if the page has 1000 lines and you find it on line 963, you had to do your contains method, 962 times when it came up negative. If the page is huge it can make sense to …

Member Avatar for Kriogenic
0
87
Member Avatar for beforetheyknew

[code] for(int z = 0; z < consumables.length; z++) { if(Array[i][0].equals(ables[z].getWord())) [/code] i''m not sure how ables max index or top relates to consumables.length. if ables went to 10 you would want to loop from 0-9 not consumables.length so maybe ables.length instead Mike

Member Avatar for adams161
0
88
Member Avatar for c.pentasuglia

you can use a text box to draw your hangman if you want and just use character based graphics. i.e. ____________ __________ | | \ / | /|\ / | \ | / \ just draw your hangman in the textbox in stages. Mike

Member Avatar for adams161
0
101
Member Avatar for adams161

I was planning on releasing the source of my applet but I wanted to wait till i was done to do that. It got decompiled before i was ready. Is there any practical way to prevent decompiling? i googled and all the articals said how easy it is to decompile …

Member Avatar for dleskov
0
94
Member Avatar for kevinkace

i googled and found this code on the web, untested: int *pI = new int; int *pArr = new int[10]; delete pI; delete [] pArr; notice their delete is delete [] variablename. maybe this is it. Mike

Member Avatar for kevinkace
0
181
Member Avatar for RoflNinja

hi, in my applet i have a paint components method. not sure if there are any other paint choices, [code] public void paintComponent(Graphics g) { Color mycolor, mycolor2, mycolor3; mycolor = new Color(5,0,0); setBackground(mycolor); super.paintComponent(g); // now i can draw shapes with the g2 methods Graphics2D g2 = (Graphics2D) g; …

Member Avatar for adams161
0
565
Member Avatar for Nightryno

it sounds like you write something like class coins { } and you make another class to run class coins. so class testinginterface { coins mycoins; // i..e coins is a variable of this class so this class can invoke it. // have methods to do operations with class coins, …

Member Avatar for JamesCherrill
0
231
Member Avatar for adams161

I"ve thought i have noticed some strange behavior after compiling. most of the time i compile the class files update with my changes. Now and then i feel i need to delete my class files in the folder and do essentially a rebuild all to make the program start working …

Member Avatar for masijade
0
108
Member Avatar for Himerz

well two things come to mind, you have a listener and i think that means you need to have your class implement it. i.e. public class MyClass implements ActionListener { you can also use your extend as well. if i remember right extend is inheritance and implement is an interface …

Member Avatar for adams161
0
100
Member Avatar for adams161

Hi, I'm doing a bouncing ball game. i'm using y=mx + b I want to know when y hits certain numbers. that means it had a collision. the numbers are whole numbers like 539 etc. I increment Y slowly because i also want to not let x move much. when …

Member Avatar for adams161
0
91
Member Avatar for aBenjamin

without reading all the code, though i looked through it, if you call repaint multiple times in different threads, or in one thread, assuring linearity, after each repaint(); you can do Thread.sleep(50); to sleep 50 milliseconds and sort of stop for now tell its repainted. Maybe have a counter in …

Member Avatar for Ezzaral
0
2K
Member Avatar for .11

you mentioned making it sleep you will need import java.lang.Thread.*; and Thread.sleep(1000); put in the program at any line, will make it sleep 1 second or 1000 milliseconds. The program tells the operating system, i'm done for now, come back to me in 1000 ms. Mike

Member Avatar for adams161
0
104
Member Avatar for Clawsy

i can't answer all your questions but this is a simple java telnet client i wrote to talk to a server ( in this case chessclub.com): [url]www.adammr.com/chessbot5.zip[/url] it implements a socket connection for sending text back and forth, it can listen and parse text it hears on the server, and …

Member Avatar for adams161
0
235
Member Avatar for NewbieProgram

It doesn't look like you have coded any type of AI at all. in terms of how to make it the computers turn and draw the board, using your design of a loop, something like this: turn=0; while(gameover==0) { turn++; if(turn%2==1) // users turn { hi input move check for …

Member Avatar for adams161
0
760
Member Avatar for adams161

Hi, i've started making a simple breakout game with java swing. This is just for fun and to learn more about java and swing. I got a frame and a panel and a mouse listener. I draw a paddle on the screen and it moves as the mouse moves. I …

Member Avatar for adams161
0
105

The End.