Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
82% Quality Score
Upvotes Received
10
Posts with Upvotes
9
Upvoting Members
7
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
3 Commented Posts
0 Endorsements
Ranked #1K
~22.0K People Reached
Favorite Tags

48 Posted Topics

Member Avatar for janvi.dodia

I dont know what the problem is, but instead dataInputStream and dataOutputStream, you can try BufferedInputStream and PrintWriter which I always use in socket programming in java. And a byte[4096] buffer maybe better.

Member Avatar for zeroliken
0
1K
Member Avatar for chetan_8187

[QUOTE=Ezzaral;802897]If you mean you want to open it for general browsing in the OS (with Explorer for example), you'll have to use Runtime.exec() or ProcessBuilder for that.[/QUOTE] Isnt there a way like java Desktop API, it can browse with default browser, cant it open a directory?

Member Avatar for sairakhushi
0
937
Member Avatar for alreem

[QUOTE=alreem;1053790]Can any one help me with this exercise . . ! I did not understnd it . ? [B] A number is called a proper divisor of N if M < N and M divides N. A positive integer is called perfect if it is the sum of its positive …

Member Avatar for milkhey
0
681
Member Avatar for gangsta1903

Hello, I am trying to write a simple javascript to read all forms. My ReadForm function works right. I tried it out of ReadAllForms function, there is no problem with it. I think document.getElementsByTagName returns false. Why can this happen? [CODE=javascript] function ReadAllForms() { if (document.getElementsByTagName) var myforms = document.getElementsByTagName("form"); …

Member Avatar for PierlucSS
0
202
Member Avatar for KirkPatrick

I think you want to get the index to be able to remove the InfoObject from the Arraylist list. You can do it without an index. You can directly pass the object to remove method. [CODE=java] InfoObject info1 = new InfoObject(); InfoObject info2 = new InfoObject(); ArrayList<InfoObject> list = new …

Member Avatar for Ezzaral
0
482
Member Avatar for rogue005
Member Avatar for joelRam90

JTextComponent class has a method: [ICODE]setDisabledTextColor(Color).[/ICODE] it will work for subclasses JTextField, JTextArea...,etc ... So, you can use this method with the components inherited from JTextComponent in your Calendar or whatever.

Member Avatar for joelRam90
0
194
Member Avatar for PhiberOptik

its hard to tell what the problem is. Maybe its because of your eclipse installation or another problem. If you try to create your jar file by yourself rather than exporting in eclipse, you can better understand the problem. [URL="http://java.sun.com/docs/books/tutorial/deployment/jar/index.html"]http://java.sun.com/docs/books/tutorial/deployment/jar/index.html[/URL]

Member Avatar for Ezzaral
0
123
Member Avatar for Alex_

you may need to call validate() and repaint() methods on the component where your button resides.

Member Avatar for Alex_
0
171
Member Avatar for hockey87

You set these fields non-editable. [CODE=java] tRadius.setEditable(false); tCirc.setEditable(false); tDiameter.setEditable(false); tArea.setEditable(false); [/CODE] But then you try to get the values from these fields. [CODE=java] radius = Double.parseDouble(tRadius.getText()); circ = Double.parseDouble(tCirc.getText()); diameter = Double.parseDouble(tDiameter.getText()); area = Double.parseDouble(tArea.getText()); [/CODE] I think you use these fields for showing output, thus you made them non-editable. …

Member Avatar for gangsta1903
0
93
Member Avatar for Dizzzy

[QUOTE=Dizzzy;1153596] Also is there a way of restricting the value being input to only being a number and not negative?[/QUOTE] [URL="http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/InputVerifier.html"]http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/InputVerifier.html[/URL]

Member Avatar for gangsta1903
0
118
Member Avatar for emanicom

yes you can. and its also better for you if you build it upon your previous work.

Member Avatar for emanicom
0
152
Member Avatar for bibiki
Member Avatar for beforetheyknew

your should create your comparator class by implementing Comparator Interface. Once you do it, then you can create your hashtable as follows: [code=java] private Hashtable<String, Planes> planesFlying = new Hashtable<String, Planes>(new YourMapComparator()); [/code] something similar to this.

Member Avatar for gangsta1903
0
427
Member Avatar for eddan

[CODE=Cpp] #include "stdafx.h" #include <iostream> using namespace std; int doubleNumber(int x) { return 2 * x; } int main() { cout << "Number to double: " << endl; cin >> x; cout << "Doubled number: " << doublenumber(x) << endl; return 0; } [/CODE]

Member Avatar for gangsta1903
0
900
Member Avatar for chixm8_49
Member Avatar for iammirko
Member Avatar for timrhon
Member Avatar for nonexcep

Well, firstly you dont need the arbitrary 11 or whatever. You just need to calculate both ends. If you subtract paddingY(paddingX) from width(length), you only handle one end. So you should subtract paddingY*2 (paddingX*2) to make the paddings equal on each side. For your second problem, if you use getHeight() …

Member Avatar for gangsta1903
0
107
Member Avatar for anders10

because the answer does not read y, it reads a whitespace character from the last read line, then it doesnt read the "y" entered. Change the following portion as this: [code=JAVA] if (w == 1) { System.out.println("X is wins!"); t.resetGame(); scan.nextLine(); System.out.println("Do you want to play? y(yes) or n(no): "); …

Member Avatar for gangsta1903
0
119
Member Avatar for RaigaX9
Member Avatar for RaigaX9
0
3K
Member Avatar for CollinRyans

[code=JAVA] int c = System.in.read(); System.out.println("You pressed the key " + (char)c + " whose ascii value is " + c); [/code]

Member Avatar for kvass
0
86
Member Avatar for Pezzy

I implemented tihs algorithm before. My approach was different. anyway, just wonder why readEdges method has a parameter M[][]?

Member Avatar for Pezzy
0
515
Member Avatar for viking3579

so much netbeans code... anyway, you use repaint() and validate(). While you use the re-paint, why not use re-validate?

Member Avatar for gangsta1903
0
423
Member Avatar for Egypt Pharaoh

no. this is what java.sun.com says: [B]A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer.[/B] If you use static strings …

Member Avatar for gangsta1903
-1
131
Member Avatar for aladar04

You are using StringTokenizer to split the words. Thats ok. But why are you using it to count the vowels? It doesn't give the right result, because it ignores adjacent wovels and counts them as one. You have to make a comparison char by char. [code=java] import java.util.*; import java.io.*; …

Member Avatar for gangsta1903
0
115
Member Avatar for wee_shark

there is already a built in mechanism that does what you want to do. its tooltip. String text = "blablahblah"; yourButton.settooltiptext(text); thats it, when the mouse hovers on it, the tooltip appears.

Member Avatar for BestJewSinceJC
0
112
Member Avatar for gangsta1903

Hello everyone, This piece of C# code does not produce any overflow exception. wordsize is a constant equal to 32. the x and y can be very big at the computation time. So big that long or decimal even cant hold. But C# handles the problem even the value of …

Member Avatar for gangsta1903
0
2K
Member Avatar for gangsta1903

[code=c] #include <stdio.h> int main() { char name[50]; printf("enter your name:"); gets(name); puts(name); return 0; } [/code] hello, the above program should first print out "enter your name:", but it does not. it occurs in this way on the console: --------------------------- abc enter your name:abc --------------------------- it prints "enter your …

Member Avatar for gerard4143
0
71
Member Avatar for CurtisEClark

have you noticed that the [CODE=java]else days = 30;[/CODE] statement always runs. you should use [CODE=java]break [/CODE]statement after every [CODE=java]if [/CODE]control. in fact, its better if you use [CODE=java]switch [/CODE]statement.

Member Avatar for AndreiDMS
0
124
Member Avatar for RTHANGAVEL

Firstly, I think you should obey java naming convention and indention rules. I didnt exactly understand your design but I can tell you why you will have to resize. Its because you use paint() method. The frame calles this method whenever the frame resizes.

Member Avatar for cbarton.a
0
110
Member Avatar for gitech

if its takes a few seconds, I assume you are using a Thread for that process. Or are you just leaving it to normal program flow?? If its the former, there are useful built-in methods to prevent duplicate runnings. If its the latter, its the wrong way.

Member Avatar for gangsta1903
0
91
Member Avatar for ramjeev

I think when button clicked, a long process is started in your application and you dont want to get any clicks until it is finished? Why dont you disable the button as soon as it clicked and re-enable it when the process finished.

Member Avatar for ramjeev
0
74
Member Avatar for ShuiYinDeng

Related to posting thread, have you heard about CODE TAGS? Also can you please write a few sentences telling what you need and what you are trying to do. Related to your problem, have you heard about DEBUGGING? What do you think the following line does?? [icode]Input = Temp;[/icode]

Member Avatar for gangsta1903
0
90
Member Avatar for begforcode

[QUOTE=begforcode;1049974][COLOR="Green"]Hello I'm new to Java. I wanted to make a card game in which i want to overlap those cards. I just want to know how to overlap cards, like "solitaire" or "hearts" card games. Kindly help... I'll be grateful.[/COLOR][/QUOTE] Use JLayeredPane. [URL="http://www.google.com.tr/url?sa=t&source=web&ct=res&cd=1&ved=0CAkQFjAA&url=http%3A%2F%2Fjava.sun.com%2Fdocs%2Fbooks%2Ftutorial%2Fuiswing%2Fcomponents%2Flayeredpane.html&ei=K4kCS829DMOe_gbh29VJ&usg=AFQjCNEn18WWpxHFjHHjkfwPAvAfniIX3A&sig2=6ZNS55mW-hmf_5aNY3Sdiw"]http://www.google.com.tr/url?sa=t&source=web&ct=res&cd=1&ved=0CAkQFjAA&url=http%3A%2F%2Fjava.sun.com%2Fdocs%2Fbooks%2Ftutorial%2Fuiswing%2Fcomponents%2Flayeredpane.html&ei=K4kCS829DMOe_gbh29VJ&usg=AFQjCNEn18WWpxHFjHHjkfwPAvAfniIX3A&sig2=6ZNS55mW-hmf_5aNY3Sdiw[/URL]

Member Avatar for gangsta1903
0
86
Member Avatar for eleal

with [code=java] join(); [/code] if you keep all the threads you created in an array,vector... then you can call join() on all threads to kill them all...Of course, this will cause all threads to be done. If you mean stopping server imediately, then just close the server... server.close();

Member Avatar for gangsta1903
0
164
Member Avatar for babylonlion

As the previous poster said, use a boolean for first click, also increment your counter in mousePressed. If you increment it in paintComonent, counter will be incremented everytime the frame is repainted. For example when you resize your frame, your counter dramatically changes. This is the fixed code. [code=java] import …

Member Avatar for babylonlion
0
174
Member Avatar for gangsta1903

As far as I know, exceptions that are not subclasses of runtime exception or error should be caught (handled). When a file exception occurs, it should be caught because its a subclass of exception class, but how can it be recovered? If file is not found,it sounds silly to recover …

Member Avatar for gangsta1903
0
102
Member Avatar for gangsta1903

Hi, assuming that Element is a class,I prefer to create an array of objects size of which is unknown in this way: [icode]Element *elementArray = new Element[length];[/icode] Is there another way to create an array of objects size of which is unknown without using new key(without malloc too)? I am …

Member Avatar for ddanbe
0
223
Member Avatar for JustLearning

you already have a dequeue function why not use such a loop [code=C++] while(!isempty()) { dequeue(); } [/code]

Member Avatar for gangsta1903
0
156
Member Avatar for gangsta1903

I want to draw a tree in Jframe, the tree view is available in the attachment, As you see there are nodes connecting to each other.I know that I have to find the midpoint of the nodes at the same level or things like that. What I want your help …

Member Avatar for Ezzaral
0
3K
Member Avatar for gangsta1903

a generalized list structure can be declared in C as follows: [code=C++] typedef struct element{ bool sign; union{ char data; element* link; }; element* link; } [/code] as you see in this approach an element can have either "data" or "element* link"(the last link is included in every element) and …

Member Avatar for gangsta1903
0
1K
Member Avatar for gangsta1903

I want to do somthing like this. [code=C++] ifstream My_File::GetFile_Stream() const { return(this->Input_Stream); } [/code] where Input_Stream is a private member of the class My_File and is declared as follows: ifstream Input_Stream; When I compile I get the following errors: /usr/include/c++/3.3.1/bits/ios_base.h: In copy constructor ` std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> …

Member Avatar for gangsta1903
0
2K
Member Avatar for gangsta1903

[code=C++] while(cin >> par1 >> par2 >> par3){ // get inputs cout << par1 << par2 << par3 << endl; [/code] I want to read three inputs with cin,as long as three inputs exist,the loop works good. But if the user enters two inputs,this time it waits for the next …

Member Avatar for gangsta1903
0
146
Member Avatar for kevin7778

change the line `cin >> n >>endl;` as `cin >> n;` cin can work like this `cin >> param1 >> param2 >> param3;` I think it's obvious that you cannot use endl with cin...

Member Avatar for kevin7778
0
130
Member Avatar for cuthien

[QUOTE=iamthwee;703303]Avoid using [icode]eof[/icode] to control file i/o:[/QUOTE] why is that?

Member Avatar for gregorynoob
1
95
Member Avatar for gangsta1903

hello,I would like to create a class for basic file operations-just reading and writing a line.There seems no error in my program but it doesn't output anything.I think there is a problem with the functions for reading and writing.Please help... [code=C++] #ifndef HANDLER_H_ #define HANDLER_H_ #include <iostream> #include <fstream> #include …

Member Avatar for gangsta1903
0
141
Member Avatar for gangsta1903

I want to create a class for I/O operations. This class take filename as parameter and then provides functions to write and read from file. I had to include two different fstream objects,one for input and one for output ,so I designed such an implementation.If you can see a better …

Member Avatar for gangsta1903
0
137

The End.