Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

JBuilder: using Design Enviroment

Hey experts,

I want to do a quick graphical interface for several forms in java using JBuilder's design enviroment (I just want to do an interface - no code behind is needed). Apparently it's not that easy as when you are using Visual Studio .NET's enviroment.....any help in this matter on design issues by someone who has used the design enviroment in JBuilder??
Avatar of b_loco
b_loco

I've used JBuilder and at first I also didn't understand how it worked.

First of all I recommend reading this:
http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html

Specially:
http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html#choosing

I think that if you read it, it will be clearer.

Understanding layouts is the most important thing
Avatar of mte01

ASKER

I have read all these sun tutorials regarding layout managers, and I know all of them from the FlowLayout manager to the GridBagLayoutManager to the XYLayout Manager of Borland.

I want to know some tricks regarding using the design enviroment in JBuilder...for example how to add an icon with a bitmap picture to a JButton.....how to add a JFrame.....etc, and of course all of this in the Design Env. (I know how to do it in the code).....
SOLUTION
Avatar of mjmohan
mjmohan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

Ok....I will be waiting for other tricks that make some of the things that I mentioned earlier more flexible........
Avatar of mte01

ASKER

One question....what has delphi got to do with Java & Borland's JBuilder????
Hi mte01,
you wrote:
what has delphi got to do with Java & Borland's JBuilder?

The answer is: The author of javadelphi discusses the connection that delphi  pascal programmers must  make in order to make the transition to writing java programs. The text  tells others too, especially those learning java,  how to start using the designer and use it to make a simple hello program and other java programs.

This is the bag of "other tricks" that you could  read (javadelphi) 6 chapters in all, so that you can correctly set up the java package forms and frames to use the designer. This text comes along with good illustrations. But then again this is my own opinion and I don't expect that you would agree.

As suggested by me earlier:
Make a package name it : "hellowordusingdesigner", copy the "HelloWorld"  and "HelloWorldFrame" program lines I gave you above by using copy, pasting.

Now  using the designer when the tab for HelloWorldFrame is up, click on any  item viewed on the designer form, then  just keep cut(ing) out the various items on the frame until you have what you want and or add more as you would select from the various pallets.  A bit of reverse construction.  Sort of like ordering a Big Mac from MacDonald's and then tossing away all the lettuce, pickle and other stuff, including the bun to get to just the meat. This is a  poor illustration at best.

D3
Avatar of mte01

ASKER

Yes okk, I agree with you delphi3, and I can make without any help a helloworld application just like the one you did....but I think that the JBuilder's design env. remains inferior to that of Microsoft's .NET, and I want to fill the gap between them...for example add a picture to a JButton at design time....add items to a JComboBox at design time.....etc...any help on doing that??
Avatar of mte01

ASKER

I sent an e-mail to myself at 10:08 AM (Sent Items)...I opened it using my webmail, it arrived at 10:09 AM (Webmail-Inbox), then I sent another e-mail to myself from the webmail at around 10:10 AM...it appeared in the sent items of the webmail as being sent at 9:00 AM, and I opened it from the inbox of the webmail, and the time of its arrival was 9:00 AM also. Then I downloaded both e-mails to the outlook......the time of the 1st e-mail was 8:59 AM, and the 2nd was 9:00 AM!!

Do I have to contact my university's mail administrator regarding this problem in the mail server, or is there a way to synchronize it from the webmail directly???
How is it related to your original question posted?
Avatar of mte01

ASKER

I apologize......I posted this comment here by mistake......(it should have been in my other question :))
Avatar of mte01

ASKER

PLEASE IGNORE COMMENT 12/01/2004 10:19AM EET
Avatar of mte01

ASKER

Ahhh.....I just realized that it only appears using my configurations 10:19AM EET.....I apologize also.....
Excused, because this is life and we tend to do mistakes... :-) Bit of philosophy...
Hi mte01,

Considering one of your earlier comments:

To get an ImageIcon to appear on one of  the buttons when running the program  this statement below "ImageIcon..... "  should be placed within the group of statements within the JFrame statements such as:


  JLabel jlblHelloWorld = new JLabel();
  JButton jbtnSayHello = new JButton();
  JButton jbtnExit = new JButton();
  // this next line is the item that should appear. It could be a .jpg, .gif, .png.
  ImageIcon TestIcon0 = new ImageIcon("bullet_red.gif"); // .gif format
 //ImageIcon TestIcon1 = new ImageIcon("bullet_red.bmp"); // .bmp format: does not  work with what I have.
  ImageIcon TestIcon2 = new ImageIcon("bullet_red.jpg"); // .jpg format
  ImageIcon TestIcon3 = new ImageIcon("bullet_red.png"); // .png format

.........

Locate the  "bullet_red.gif", "bullet_red.jpg" and "bullet_red.png" in the same folder as the .jpx listing,  That is,  with the other items such as the src, classes, bak.

Now opening the designer, and clicking on the button that the icon will be added, the properties listing will show a new options within the options for icon as 4 options:
 <none>, TestIcon0,TestIcon2,TestIcon3.
 
Select the any of these later 3 icon choices  and  that ImageIcon will be added to the program by the designer appearing as a new line:

jbtnExit.setIcon(TestIcon0);

Should one of the others been selected that line would be modified accordingly.

It will also appear while the designer is viewable, provided it can find the image selected and if it is acceptable type, and if the exit button is clicked on.  And of course when a run is executed.

I have also tested  the .bmp and a  .ico image format and it does not show. However if  with addtional resources, it may be shown.

Delphi3



 
Avatar of mte01

ASKER

Ahaa....I see.....what I was afraid of, is that there are still things that you have to do in the code (unlike Visual Studio .NET), if I was the one who is using it, I would rather do everything in the code, but this for a friend of mine who would like to have the ease of Microsoft's .NET in JBuilder's GUI Design Environment.....
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

Yes....right...I have JBuilder 6 with the full blown enterprise edition, and it has the same features as JBuilder X Foundation, but with only additional "server-based" features like using JDBC & JBCL (JBuilder's DB) drivers, and wizards for JSP pages, and multi-threaded programs, in addition to drawing UML diagrams for the code that you are writing (but this is only per class), but all of these features do not fit us in the design enviroment, so as you said it is better to design java models from existing ones.....which would help us in some cases after having drawn several forms.

I'll be waiting for any extra comments before closing the question.......
Hi mte01,

Thanks for the points and grade.  I appreciate it.

Delphi3