Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Can I use IDE to create GUI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Can I use IDE to create GUI?" Watch "Can I use IDE to create GUI?" New topic
Author

Can I use IDE to create GUI?

Ruigao Tang
Greenhorn

Joined: Jul 26, 2007
Posts: 9
Hi,ranches.

I noticed that "you must not submit any code that is not your own work" in the instuctions.

I designed the gui in a IDE, and it generated code for me. Although I didn't write the code directly, I think it's my "own" work.

I wonder if Sun think like that as me?

Thank you , and forgive my English


SCJP: Certified SCJD: Certified SCEA: One day...
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

If I were you I would not use the IDE to generate GUI code. Because those generated methods like "init" or whatever can in fact be put in the constructor directly. Also you would learn more without the IDE help.

Also greyed-out code in the IDE like Netbeans are considered "generated code".


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Ruigao Tang wrote:Hi,ranches.

I noticed that "you must not submit any code that is not your own work" in the instuctions.

I designed the gui in a IDE, and it generated code for me. Although I didn't write the code directly, I think it's my "own" work.

For me, generated codes that are not only for convenient such as getter/setter or generated methods that implement interface or override methods from superclasses are not your work.

You may check if there are options to control generated codes.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Kengkaj Sathianpantarit wrote:For me, generated codes that are not only for convenient such as getter/setter or generated methods that implement interface or override subclasses are not your work.


Agreed.

Ruigao, just to give you a position, here's what I did: at first, I created an interface and generated the code related to the GUI part using a tool called WindowBuilder, and had this code implement my interface. Then, I went to the fun part (server, Data class, etc), and after I finished everything, I created myself the code that would build the same things that were generated by the tool, so I left the GUI part to the end of the project, and since the generated code was already implementing my interface, there was no impact when I replaced the generated code by the code that I created. And for sure, if they see some generated code in your project, you'll be automatically failed. For instance, the SpringLayout was added to Swing specifically to support GUI builders, so if they see it in your code, then it's pretty likely that that code was generated.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Ruigao Tang
Greenhorn

Joined: Jul 26, 2007
Posts: 9
And for sure, if they see some generated code in your project, you'll be automatically failed.


automatically failed? How terrible words they are!

I want never be automatically failed, because the exam is too expensive for me.

Roberto, your way to develop looks professional, and I think it will be useful for my development in the future.

K. Tsang, your are right, I finished the gui finally without IDE help and had a great sense of accomplishment. I think it's more readable than generated code.

Thank you all the same, Kengkaj.
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Roberto Perillo wrote:
Ruigao, just to give you a position, here's what I did: at first, I created an interface and generated the code related to the GUI part using a tool called WindowBuilder, and had this code implement my interface. Then, I went to the fun part (server, Data class, etc), and after I finished everything, I created myself the code that would build the same things that were generated by the tool, so I left the GUI part to the end of the project, and since the generated code was already implementing my interface, there was no impact when I replaced the generated code by the code that I created. And for sure, if they see some generated code in your project, you'll be automatically failed. For instance, the SpringLayout was added to Swing specifically to support GUI builders, so if they see it in your code, then it's pretty likely that that code was generated.


nice advice!
what layout did you use? I intend to use CardLayout to switch between the JPanels and use GridBagLayout to make the forms.
what do you think?
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
it submitted twice :/
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Fala ai Leandro!!!

I intend to use CardLayout to switch between the JPanels and use GridBagLayout to make the forms.
what do you think?


I think it'll look great in the end!!!
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5216
    
  12

Hi Leandro,

I'm wondering why you will need a CardLayout to switch between the JPanels. Which panels are you planning to create?

I'm also using a GridBagLayout for constructing my panels

Regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Roel De Nijs wrote:Hi Leandro,

I'm wondering why you will need a CardLayout to switch between the JPanels. Which panels are you planning to create?

I'm also using a GridBagLayout for constructing my panels

Regards,
Roel


Hi!

Do your application will have only one jpanel? If not, how do you intend to switch between them?
The way I found is to use CardLayout. Do you know a better way to do this?

Thanks,
Leandro
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Hey, Leandro!!!

It's just that switching between panels isn't really necessary
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Roberto Perillo wrote:Hey, Leandro!!!

It's just that switching between panels isn't really necessary


Suppose you have two forms in different JPanels: one for record users and others to record movies.
How do you do to show one JPanel and then other.

I do it using CardLayout.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5216
    
  12

My application has:
- a jframe for starting/stopping server and entering the settings
- a dialog for the settings of the client-application
- a jframe that's the main window of the client application (contains search criteria + jtable)
- a dialog containing the room details (which could be used for updating, deleting, booking, unbooking,... a hotel room, but now is just used for booking one)

that's all i have and honestly i don't have any clue where you want to switch panels. the example you gave: there are no users nor movies.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Roel De Nijs wrote:the example you gave: there are no users nor movies.


But there could be

Ok, I'm kidding here What my good buddy Roel is saying here is that there isn't such situation, you know... the windows we have to build are supposed to be simpler than that, so there isn't really the need to switch between panels...
 
 
subject: Can I use IDE to create GUI?