Hello people, Question 1. I have a problem. I want to have the toggle effect for a Jbutton. How to do that? Example: In microsoft paint, click on Pencil button and it will look like PRESSED until you click another button. How to do that with a JButton. Do I have to use a panel or something similar and change its 3D effects for mouse clicks? I have done like that in some other languages like Visual FOx Pro.
Question 2. I am using Sun One studio 5. For a JPanel I added an icon and when executing through ID I cannot see the Icon. But when I am executing the class using Command Prompt I see it. What is the problem? I experienced this problem in JBuilder too. Any reason for that? But when providing full path as.... Icon image = new ImageIcon("C:\icon.jpg"); it gets displayed through IDE.
Question 3. How to get the current path? Example is for JApplet you can use getCodeBase(). What are similar functions.
Thanks, Toggle Button was accomplished. Yes I typed them manually. Reason was that GUI form used the absolute path of the icon and I didn't want that. What I wanted to have was the relative paht. By the way I am not using GUI form editor because I want to do everything manually (At least for sometime to get familiar and memorize important teqniques).
You can type the path manually, but only in the properties panel.
I don't think there exists any GUI editor wich reads your code and then creates the components.
I'm using Netbeans IDE. Netbeans creats a .form file wich contains all the informations displayed on the screen. From this file it creates the java source code. The locked parts of the code are the parts created by the IDE. You can add components manually, but they won't be shown in the editor.
If you have specialized components you have to add them manually or to create a Java Bean and import that one in the IDE. Creating GUI Beans is a lot of work, so normally I use the GUI Editor to create all the standard stuff and then add my additoinal components.