pankaj bansal

Greenhorn
+ Follow
since Mar 07, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by pankaj bansal

hi all,
A couple of days back i put a question on text and image problem with Textpane using HTML content type.. but I didn't get any reply.. Any how I tried many things and finally got a solution to use HTMLEditorkit for textpane.
Now my problem is that the image icon is bottom aligned with the text and not centered align. Means the image is shifting up a bit due to the guttering and all.
I tried to put a button for the image on the textpane but didn't work.
pl give some valuable suggestions.
bye
Pankaj
------------------
SCJP2
22 years ago
Hi all,
Does Java support Symbol font?
If it doesn't then is there any alternative font to display those characters in Java.
Eg. angle symbol.
Thanx in advance
Pankaj
------------------
SCJP2
22 years ago
Hi All,
I will be thankful to all of u, if u can give me suggestions for this problem.
I want to display text and image stored in a table in HTML format in the database.
For eg.
My name is Pankaj.

The image is in another table with this name(not as a physical file).
What I'm doing is displaying it in a panel with text in JTextpane and image as label. The content type of JTextPane is text/html.
The problem comes when the text length is bigger than the textpane width and it scrolls down to second line. At this moment I can't display the image next to the end of text b'coz of textpane size.
I tried to display the text in a go but then it gives blank image icon on the screen. But I'm not able to locate the position of image on the screen overwrite image label onto it.
Please give me an appropriate solution to fix this problem.
Thanx
Pankaj
------------------
SCJP2
[This message has been edited by pankaj bansal (edited September 16, 2001).]
22 years ago
Hi all,
Can we create a DSN for DB in Java?
Thanx.
------------------
SCJP2
22 years ago
A million thanx Jim. I got the point.
Thanx once again.
Bye
Pankaj
------------------
SCJP2
23 years ago
Thanx Is
I appreciate ur response but I don't think that has any relation with printer driver. B'coz I want to display on the screen and anyway I can take the printout of the file in which the characters r stored. But the problem remains the same that's via System.out.println() the desired o/p is not coming.
Bye
pankaj
------------------
SCJP2
23 years ago
hi
First of all u can't write
java Hello.class
for the reason that it'll then search for "Hello/class" class file.
Then check for the place from where ur friend is loading the class file. Or what u can do is add the current dir. in the classpath i.e from where the class ur loading. U can write
set classpath=%classpath%;.;
Bye
pankaj

------------------
SCJP2
23 years ago
Thanx Matts Thanx Jim
I tried Matts' code and it runs perfectly alright and displayed me the char values between 128-159. But it is not clear to me that when I displayed that in the SOP it gives the same old o/p. Why?
Jim as u said these r not printable characters then how is it able to save in the file?

------------------
SCJP2
23 years ago
Thanx Jim
Can u tell me how to install the unicode characters so that I can get the those char values.
Thanx in advance
Pankaj
------------------
SCJP2
23 years ago
hi
for normal user just give them a .bat file in which u can write
java classfilename
I think this will solve ur problem
bye
pankaj
------------------
SCJP2
23 years ago
Hi Helmut
What u can do is import that package in ur program ,define the classpath for the jar files. This way u will be able to access any class of that package.
bye
pankaj

------------------
SCJP2
23 years ago
Hi Angela
In simple terms,passing by Reference means passing the address of the object and any change there would make the change of value at that address directly.So no return value is needed.
On the other hand passing by value means passing the value placed at that address so change in the value do not affect the value placed at that address. So u need to return the value to get the changed value.
I think this would help u.
bye
pankaj

------------------
SCJP2
23 years ago
Hi
ya its necessary to precede with 'static' to make a block static. Otherwise its a non-static block that executes only when a constructor is called i.e when an instance is created. When a class is executed the flow is something like this
static block->non-static block->constructor
static block always executed on the loading of class.
class DemoStatic
{
static
{
System.out.println("static");
}
{
System.out.println("non-static");
}
DemoStatic()
{
System.out.println("constructor");
}
public static void main(String a[])
{
new DemoStatic();
}
}
I think this will help u to see the difference.
bye
pankaj
------------------
SCJP2
23 years ago
Hi Indira
I'm sending u this code that will surely help u to see that how the capacity of vector inc. at runtime. One thing I want to point out is that anything that is done with objects is at runtime and not at compile time.
import java.util.*;
class DemoVector
{

Vector v=null;
public static void main(String args[])
{
DemoVector d=new DemoVector();

d.v=new Vector(2,2); // will inc. by 2 automatically
System.out.println("size:"+d.v.size());
System.out.println("capacity:"+d.v.capacity());
d.v.addElement("pankaj");
System.out.println("size:"+d.v.size());
System.out.println("capacity:"+d.v.capacity());
d.v.addElement("bansal");
System.out.println("size:"+d.v.size());
System.out.println("capacity:"+d.v.capacity());
// You can use in this way
d.addToVector(d,"Prateek");
System.out.println("size:"+d.v.size());
System.out.println("capacity:"+d.v.capacity());

}
void addToVector(DemoVector d,String s)
{
d.v.addElement(s);// capacity of vector will inc at run time

}

}
------------------
SCJP2
23 years ago
Hi
The would say that granularity of code is directly related to modularity in coding.But it has a broad meaning when related to the whole application i.e the optimized code, less memory leakage, granularity in comments and many more..
The second query that u have asked is about vectors.
See, vectors have the capabilty to increase their capacity at run time automatically and developers don't have to worry about the size of vector as in the case of array. That's why u can add the objects in it at compile time as well as at run time without bothering of the size of vector.
I think this would help u.
bye
pankaj
------------------
SCJP2
23 years ago