Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Jahanzeb Sayal

+ Follow
since Mar 02, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jahanzeb Sayal

The question is about closing the browser by clicking the top right button of the browser not from the script.
i found swings very slow imn painting... but as far as loading of frmaes are concerned ... there is no such differnce.. but is the GUI is repainted repeatdly.. dont use Swings... it will the overall aplication very slow....
19 years ago
I also have a same problem but the image is not on the on the title bar but used as splash screen. But if i provide the image in the correcct path outside the jar file it works perfectly.
What can i say is that it is due to the slow loading of images?
Anyone else with a better answer will be welcomed....
Jahanzeb Sayal
19 years ago
You can see an example of it on -- the paint applet.
You can urself make such an applet by making use of rubber-banding technique.
19 years ago
Images(Icons) cant be displayed in Button class provided by java.awt package because it is an OS widget . The most you can try is that u can extend Button class & override its paint method draw image there it will be shown instead of rectangular button but i havent tested it in detail & i got poor results you better use swing JButton.
You can change the curosr on the button by using setCursor(Cursor cursor) of the Component class super class of every component in java.
Check java documentation for details.

[This message has been edited by Jahanzeb Sayal (edited April 21, 2001).]
19 years ago
you should post the code for the loading & for the action event of the button on JFrame1 just post the outline it will help me to find out the problem .
19 years ago
I have tried this code on Windows 98 IE 5 & the resize behavior is perfectly working as programmed. Try it ! & reply me if its working or not...
import java.awt.Button;
import java.awt.Frame;
import java.awt.FlowLayout;
import java.awt.Label;
import java.applet.Applet;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
class TestApplet extends Applet implements ActionListener
public void start()
Button but1 = new Button("Show Frame");
setLayout(new FlowLayout());
public void actionPerformed(ActionEvent e)
Frame f = new Frame("Hello Testing");
f.setLayout(new FlowLayout());
Label l = new Label("Hello");
19 years ago
You cant check the whether the close button of browser is cicked or not bcoz JavaScript built in ojects are defined in DOM and there is nothing like close button of browser in DOM... what most u can do is that u can check the unload event of your document.
Here is an example

<script language = "JavaScript">
function abc()
<body ONUNLOAD = "abc()">

This is the only way that you can execute script when user is leaving your site.

[This message has been edited by Jahanzeb Sayal (edited April 18, 2001).]
Hii Kajol...
Thanks for replying...
As far as awt is concerned you can do it manually bcoz in awt OS widget is used and you have a little flexibility.
You can limit the size of display by using the constructor of TextField as follows
TextField(int numChars)
Here numChars speicifies the size of TextField in size.
As far as limiting the amount is concerned as far as i can do...
There are two methods
1)After user has input the value u can check it by calling String class length() method.
2)The other way that u can do it by using the TextEvent.
The second method is burdebsome becasuse all the times the text is changed in textfield the code in the TextEvent will check the String length.. But it will check at the input level..
With First method u can also check at the input level by using the FocusEvent i.e when the textfield lose focus u can check the length of field...
Tomorrow i will also post the code.

19 years ago
MultiPage printing is possible using Graphics2D ...
Read the printing article on & also read chapter 6 of the following online book i belive it will work becoz i have just done it... if any problems ... tell me i will post the code... u can email me...
19 years ago
Trying using appropriate Layout instead of using null or GridLayout Gridbaglayout is difficult but it will manage the components as we want...
Posting the code will .... to find out is it layoutmanaer or any other thing that is creating the problem...
19 years ago
posting code will help...
19 years ago
I am using scale() method of Graphics2D to zoom in and zoom out the contents of my JPanel... i have added this JPanel to JScrollpane. JScrollPane is working initially if i zoom in the JPanel... JScrollPane wont show ScrollBars... can anyone guide me a little bit...
& there is a good news for all that at the end of my project i will post the code to javaranch demonstrating how to print reports i have been working on the project from last 1 month...
& it will also solve the problem of many Ranchers....
Waiting for ur cooperation...

I will also encourage if u tell me any resources that are available on net...
19 years ago
You can also take advantage of executable jars introduced in Java2. You can refer to tech tips archive on & refer to tip regarding executable jars.
I hope it work & also it is platform independent.
Other ways to convert a file into .exe is to download various utilities from but i cant say anything regarding performance.
19 years ago
Can anyone tell me that JBuilder can generate report for me?
or tell me the basic procedure.
19 years ago