Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
81% Quality Score
Upvotes Received
7
Posts with Upvotes
7
Upvoting Members
6
Downvotes Received
2
Posts with Downvotes
1
Downvoting Members
2
3 Commented Posts
0 Endorsements
Ranked #914
~18.7K People Reached
About Me

Developer

Favorite Tags

46 Posted Topics

Member Avatar for sravan953

Stringbuffer has a reverse method [url]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html[/url] Im not sure I understand completly what you want to do though There is also a method in String called charAt(int pos) which returns the char at the given position

Member Avatar for JamesCherrill
0
609
Member Avatar for jooa

In drawCircle g is null. That is why you get null pointer exception and that is also why nothing is being drawn. You need to get the graphics from the Panel which is pressed. You can get this info from the event, e.getSource(); which returns an object. Type cast this …

Member Avatar for Roberdus
0
4K
Member Avatar for peter_budo

In your code you have the wrong comparisson: m.equals(methodObj) should be m.getName().equals(methodObj) since m contains "public void bla bla()" And when you invoke the method you need to invoke it with an instance of the class, e.g: m.invoke(new Counter(), count); I think :)

Member Avatar for svedrenne
0
3K
Member Avatar for nipponsahore

Hi, I'm pretty sure the problem is when you create a new TestPage. Look at line 56 (and also line 84): new TestPage(quesNo++); The ++ operator increments quesNo AFTER this operation. If you want to increment it before use ++quesNo instead.

Member Avatar for nipponsahore
0
180
Member Avatar for Andy_Parr

Hi, you can use java.awt.Rectangle, however I don't think you can draw these directly using drawRect(). But you can use the x, y, width and height of your rectangles and draw. By using rectangles you can ask each rectangle if they contain a point (mouse x and y for instance). …

Member Avatar for JamesCherrill
0
637
Member Avatar for aro_kai
Member Avatar for yap_1991

Hi, do you mean something like this: [CODE] query1 = new JRadioButton("for uploading of file"); query1.setLayout(new FlowLayout()); query1.add(new JTextField("textfield")); query1.add(new JButton("Button")); [/CODE]

Member Avatar for di2daer
0
179
Member Avatar for hatux

inputArr is null, you must create the array before you use it. e.g. [CODE] inputArr = new String[8]; [/CODE]

Member Avatar for hatux
0
132
Member Avatar for ponens

Isn't this because of timezones? I think you might need to adjust. Something like: [CODE] TimeZone tz = TimeZone.getDefault(); long gmtAdjust = tz.getDSTSavings()/1000; [/CODE] But I'm not really sure though...

Member Avatar for di2daer
0
130
Member Avatar for NewOrder

at Screen.restoreScreen(Screen.java:37) points to this line: dv.setDisplayMode(null); According to API: [CODE] Throws: IllegalArgumentException - if the DisplayMode supplied is null, or is not available in the array returned by getDisplayModes UnsupportedOperationException - if isDisplayChangeSupported returns false [/CODE] You should get an IllegalArgumentException though, but I think this line is a …

Member Avatar for NewOrder
0
339
Member Avatar for gampalu

Hi, I can't see any faults in your code, so my guess is that the program is unable to find the image. If your folder structure looks like this: .\src\sess31\myownapplet.java then place the image like this: .\src\image.gif or specify the location in the path. Hope this helps!

Member Avatar for Alimuzzaman
0
694
Member Avatar for sselwyn

Hi, you get the wrong result because you have the print out before the recursive call. [code=java] if(n > 0) { triangle(n-1); for(int i = 0; i < n; i++) { System.out.print("*"); } System.out.println(""); } } [/code] What happens here is that you do not print anything until you've reach …

Member Avatar for di2daer
0
121
Member Avatar for akulkarni

I think that you can write a server/client solution to get it to work. The client connects to the server which returns the content of the database. I did something like that when I needed my applet to read from a database, but I don't remember all the details.

Member Avatar for akulkarni
0
251
Member Avatar for sony1988.sc

Hi, This is one way to do it: 1. Loop through the array and for all 0's assign its value to -1 2. Store the number of elements that is to be removed, so you know the length of the new array. 3. Create a new array and copy all …

Member Avatar for Jocamps
0
123
Member Avatar for gitech

I think there is a method called setFullScreen(boolean value) that you can use.

Member Avatar for peter_budo
0
417
Member Avatar for javapal
Member Avatar for mrnutty
0
101
Member Avatar for locked_twilight

I think you have a little design flaw. The result is not always the first input, and I think that is what is causing the problem. I am not completly sure though. Try to rethink your design with a piece of paper and a pen.

Member Avatar for locked_twilight
0
146
Member Avatar for locked_twilight

Hi, you should really use code tags when posting code, it is way to hard to read without... Anyway, the errors I've spotted are: [code=java] private String[] keys = ("7", "8", "9", "/", "4", "5", "6","*", "1", "2", "3", "-", "0", "C", "=", "+"); [/code] When initializing arrays you should …

Member Avatar for locked_twilight
0
950
Member Avatar for kat1

Hi, J2ME does not have all the standard libraries that J2SE has. PrintWriter and BufferedReader doesn't exist in J2ME. Maybe you can use DataInputStream and DataOutputStream instead? You can do a quick search on google to get loads of tutorials and examples. Hope this helps

Member Avatar for sincerelibran
0
111
Member Avatar for emilio

Hi, Check this: [url]http://www.j2ee.me/javame/reference/apis/jsr118/javax/microedition/lcdui/Display.html#setCurrent%28javax.microedition.lcdui.Displayable%29[/url] It says that the setCurrent() call can be delayed. It also says: "If the application calls setCurrent() while a system screen is active, the effect may be delayed until after the system screen is dismissed.", so try to do: [code=java] /* "minimize" */ setCurrent(null); /* Set …

Member Avatar for peter_budo
0
222
Member Avatar for JameB

Hi, you need to import java.io.*, and also surround with a try/catch clause. You can also use Scanner to read input. [code=java] Scanner sc = new Scanner(System.in); sc.nextLine(); sc.close(); [/code]

Member Avatar for JameB
0
151
Member Avatar for buchanan23

I think you need to refactor a bit. Refreshing the form will be hard since all the variables are stored inside the constructor, even the input from the user. Declare all the forms and the arrayOfBooks as global, and then use the actionevent listener to fire an update of the …

Member Avatar for buchanan23
0
2K
Member Avatar for KirkPatrick

I didn't read your code very carefully, but this sounds like a problem I experience from time to time. You need to close the file when you're done writing to it. Otherwise you will just create it, but it will remain empty.

Member Avatar for BestJewSinceJC
0
717
Member Avatar for jds_14

You can use LinkedList or Stack: [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedList.html[/url] [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/Stack.html[/url] [code] LinkedList<String> fifo = new LinkedList<String>(); fifo.add("First"); fifo.add("Second"); fifo.add("Last"); System.out.println(fifo.poll()); System.out.println(fifo.poll()); System.out.println(fifo.poll()); Stack<String> lifo = new Stack<String>(); lifo.add("First"); lifo.add("Second"); lifo.add("Last"); System.out.println(lifo.pop()); System.out.println(lifo.pop()); System.out.println(lifo.pop()); [/code] gives: [code=java] First Second Last Last Second First [/code] Or did you want to implement one yourself?

Member Avatar for BestJewSinceJC
0
128
Member Avatar for Acidburn

Hi, Check the PIM API [url]http://developers.sun.com/mobility/apis/articles/pim/index.html[/url] I haven't tried anything like it myself though.

Member Avatar for peter_budo
0
84
Member Avatar for anusha88

The graphs I've created has been done with JFreeChart, I think it works pretty good for my needs. I found this link however that might help you: [url]http://www.codemiles.com/java/a-moving-graph-sortof-widget-build-using-swing-t373.html[/url] It is done in swing

Member Avatar for di2daer
0
192
Member Avatar for kg4cxl

Hi, I think the constructor in class dvdInv is incorrect, loose the void [code=java] public dvdInvGui() { } [/code] Methods has returns types, constructors does not

Member Avatar for di2daer
0
193
Member Avatar for lakshay

10 = is an integer 010 = is an octal (base 8) So 010 = 1000 in binary 1000 0100 ------ 1100 = 12 I think this is how it works at least :)

Member Avatar for llemes4011
0
111
Member Avatar for rizillion
Member Avatar for akulkarni

Hi, when you create your array you give it the length of all the characters in the string you're analyzing, but you're not initiaing it, so it contains only null (s2[0] = null, s2[1] = null etc) since string is an object. In the last for-loop you're calling method compareTo() …

Member Avatar for akulkarni
0
144
Member Avatar for Acegikmo

Hi, how much realism do you want to add? I mean, real formulas or just something that looks good and works fine for your purpose? If you just want to slide the character a little distance you can perhaps use a constant slide value, and then use Sinus. Something like: …

Member Avatar for VernonDozier
0
278
Member Avatar for sympatiko

Get the inputs from the user and form the first 2 numbers in the fibonacci sequence, then populate the rest in a loop by sumarizing the previous two numbers. (3+8=11, 11+8=19, 19+11=30 etc) In order to decide whether a number is odd or not, you can use %(modulus)2. E.g. 5%2 …

Member Avatar for VernonDozier
0
111
Member Avatar for manveet

You're missing an import statement for FileOutputStream, other than that, I can't spot any errors with this code. I think you'll have to explain a bit more about when you get this error. In what context are you using it?

Member Avatar for kvprajapati
0
123
Member Avatar for anusha88

If you're using eclipse you can choose to add them as external jars. Right click the project and select build path-> configure build path -> (Libraries tab) add external jars.

Member Avatar for anusha88
0
425
Member Avatar for Acidburn

Please correct me if I am wrong, but I don't think it is possible to send files via the serial connection, but you can use bluetooth or obex for that. What kind of file do you want to send? If it is a simple text file you can send the …

Member Avatar for di2daer
0
112
Member Avatar for adyopo

Im not sure I understand your question, but anyway... First of all, it looks like you're sleeping the main thread, which will cause your application to freeze for a number of seconds. I might be off here but do you want to fire a new thread for each button but …

Member Avatar for adyopo
0
130
Member Avatar for Acidburn

You need to have support for JSR-75. You're phone most likely has support for it, but you might want to make sure. On my device (Sony Ericsson) the filesystem is reached through "file:\\\c:\path" and the memory card is reach through "file:\\\e:\path".

Member Avatar for di2daer
0
299
Member Avatar for Pradeep.sibar

There are some tools that can be used for that, google for jar to exe or something similar. Can't you use a jar file? I use eclipse and fatJar is working fine for me when I have dependincies. Here is an intressting article on that subject: [url]http://www.excelsior-usa.com/articles/java-to-exe.html[/url]

Member Avatar for jbennet
0
91
Member Avatar for suretd

Im not sure what you are asking for, but this is how you create an inner class: [code=java] public class MyClass { public MyClass() { // Constructor for MyClass } private class MyInnerClass { public MyInnerClass() { // Constructor for inner class } } } [/code] I usually use inner …

Member Avatar for di2daer
0
133
Member Avatar for painless

In order to understand that I think you need to know what a sequencer is, when you know that, the statement should be fairly obvious: You get the default sequencer. [url]http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/midi/Sequencer.html[/url]

Member Avatar for painless
0
89
Member Avatar for johndb

I hope I understand your question correct: You can set the tab size to zero. Right click your project and press properties. Expand Java Code Style and select Formatter. Click "Enable project specific" and press the 'edit' button. Here you can change the tab size of the indent. You need …

Member Avatar for johndb
0
87
Member Avatar for choybutchoy

This should help you out: [url]http://www.devx.com/tips/Tip/14510[/url] Just add a pop-up message when the if evaluates to false, and you're good to go! Good luck

Member Avatar for choybutchoy
0
104
Member Avatar for sravan953

There is no match because you keep incrementing i only. Example: if you have the word Banana and want to find all a's: In the first iteration the string 'B' is compared to 'a' and evaluates to false, the second iteration (d has remainded unchanged thus is 0 still) is …

Member Avatar for BestJewSinceJC
0
164
Member Avatar for Iamkishan

Javac is an exe file which resides in your jdk folder. (C:/Program/java or similair) You can either write the full path to it and the the classes you want to compile or add the path (it´s in the bin folder) to your environment variables (Right click My Computer->properties->advanced->environment variables: path) …

Member Avatar for di2daer
0
86
Member Avatar for peter_budo

Hi, I think it is because you don't have the correct fonts intstalled. It is the same thing with "\u0626" (which is an arabic character if I'm not misstaken). Try to find and install some language pack including the required font.

Member Avatar for di2daer
0
114
Member Avatar for stilldancin12

With this: java.util.Date bdate = java.sql.Date.valueOf("1990-07-21"); you can get the value of a string, so get the value of the input from the user. Then you can use this value to get the day (represented as an integer): bdate.getDate() . Thats pretty much it, if you want the output to …

Member Avatar for di2daer
0
101

The End.