Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!

Jahanzeb Sayal

Greenhorn
+ Follow
since Mar 02, 2001
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 Jahanzeb Sayal

Hii
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....
18 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
18 years ago
You can see an example of it on www.anfyjava.com -- the paint applet.
You can urself make such an applet by making use of rubber-banding technique.
18 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).]
18 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 .
18 years ago
Hii
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());
but1.addActionListener(this);
add(but1);
}
public void actionPerformed(ActionEvent e)
{
Frame f = new Frame("Hello Testing");
f.setBounds(10,10,200,300);
f.setLayout(new FlowLayout());
Label l = new Label("Hello");
f.add(l);
f.setResizable(false);
f.setVisible(true);
}
}
18 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

<html><head><title>Example</title>
<script language = "JavaScript">
function abc()
{
statements...
}
</script></head>
<body ONUNLOAD = "abc()">
</html>

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.
Note:
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.

18 years ago
MultiPage printing is possible using Graphics2D ...
Read the printing article on www.javaworld.com & 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...
http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/index.html
18 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...
18 years ago
posting code will help...
18 years ago
Guys....!!!
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...
18 years ago
You can also take advantage of executable jars introduced in Java2. You can refer to tech tips archive on www.javasoft.com & 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 www.download.com but i cant say anything regarding performance.
18 years ago
Can anyone tell me that JBuilder can generate report for me?
or tell me the basic procedure.
18 years ago