What advantage do Java’s layout managers provide over traditional windowing systems? - Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java’s layout managers aren’t tied to absolute sizing and positioning, they are able to accomodate platform-specific differences among windowing systems.
What is the difference between the paint() and repaint() methods? - The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.
How can the Checkbox class be used to create a radio button? - By associating Checkbox objects with a CheckboxGroup
What is the difference between a Choice and a List? - A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.
What interface is extended by AWT event listeners? - All AWT event listeners extend the java.util.EventListener interface.
What is a layout manager? - A layout manager is an object that is used to organize components in a container
Which Component subclass is used for drawing and painting? - Canvas
What are the problems faced by Java programmers who dont use layout managers? - Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system
What is the difference between a Scrollbar and a ScrollPane? (Swing) - A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.
Except for the general questions about layout managers, most of those questions are the kind that I would not expect someone to necessarily remember off the top of their head. Worse yet, they give no real indication of knowledge, skill or experience in the domain.
BTW, JScrollBar *is* a container, as is JScrollPane - look it up.
Tech interview questions can often be divided up into three categories:
1) Trivia questions that only someone with a really good memory could answer all the time. Most of these are irrelevant and would be the kind of thing I would expect someone to lookup in documentation to figure out or remember. That is why we have documentation. Worse yet, they are often some list that someone got off a website or via email, and not only are the questions useless, but they may be flat wrong or at least misleading (#9 was wrong).
2) The “how many manholes are there in Seattle?” type questions. These are stupid questions asked by people who justify the questions by saying they want to see how you think. Almost invariably they are asked by people who are wholly unqualified to make such judgments based on totally inadequate questions for the purpose.
3) Questions that are more general and geared towards showing whether someone is knowledgeable and experienced in the area of expertise needed for the job they are interviewing for.
Question types 1 and 2 are generally useless, or worse, misleading. For example, today I could tell you the order of the path components that JTree expects in a view update notification event, and the order of indices for same, but six months from now I would probably have forgotten those details. It doesn’t mean that if I had to write that logic again I could not do it correctly because I know where to look, and I know it is important to do it right. But that is trivia and not really important to remember the details of.
Questions of type #3 are very useful, but require someone who themselves is knowledgeable and experienced in the domain. If you don’t have that person (maybe that is why you are interviewing), then either find someone who can temporarily fill in (maybe a consultant) or accept that you just won’t know if they know, and go by references.
Questions of type #3 for a Java GUI designer would maybe be questions covering something like:
a) Layout managers in general - not trivia about each and every one, but what they are, and maybe some of the pitfalls/advantages of a few - the choice of the managers up to the person being interviewed.
b) The proper use of threading (if applicable, and it is getting more relevant every day), SwingWorkers, what should and should not be done on the Swing/AWT Event thread, what should not be done on a background non-Swing thread (hint: don’t manipulate realized Swing components on non-Swing threads).
c) Discuss the MVC concept, how Swing components implement this. If applicable, how would the person scale the model and the view of a JTree or JTable?
d) Maybe the difference between SWT/JFace and Swing/AWT - but unless the job entails the use of SWT/JFace, or they claim the knowledge/experience I would not necessarily expect the person to know much about it.
I could come up with many more if I wanted to, but without writing paragraphs and paragraphs, I could not give you answers to the questions that would really be applicable, and even if I did, you probably wouldn’t be able to judge whether the person being interviewed answered correctly. In this domain, there are usually as many correct answers as there are wrong answers. It takes a person knowledgeable in the domain to understand the difference - and such people won’t be coming here looking for the questions and answers.
Why did I come here? I was googling for a particular type of layout manager to solve a problem, and just thought I would take a few minutes to respond.
2 Comments on Java GUI designer interview questions
how can i convert a .gif file into a .png file in j2me programming for mobile devices.
Except for the general questions about layout managers, most of those questions are the kind that I would not expect someone to necessarily remember off the top of their head. Worse yet, they give no real indication of knowledge, skill or experience in the domain.
BTW, JScrollBar *is* a container, as is JScrollPane - look it up.
Tech interview questions can often be divided up into three categories:
1) Trivia questions that only someone with a really good memory could answer all the time. Most of these are irrelevant and would be the kind of thing I would expect someone to lookup in documentation to figure out or remember. That is why we have documentation. Worse yet, they are often some list that someone got off a website or via email, and not only are the questions useless, but they may be flat wrong or at least misleading (#9 was wrong).
2) The “how many manholes are there in Seattle?” type questions. These are stupid questions asked by people who justify the questions by saying they want to see how you think. Almost invariably they are asked by people who are wholly unqualified to make such judgments based on totally inadequate questions for the purpose.
3) Questions that are more general and geared towards showing whether someone is knowledgeable and experienced in the area of expertise needed for the job they are interviewing for.
Question types 1 and 2 are generally useless, or worse, misleading. For example, today I could tell you the order of the path components that JTree expects in a view update notification event, and the order of indices for same, but six months from now I would probably have forgotten those details. It doesn’t mean that if I had to write that logic again I could not do it correctly because I know where to look, and I know it is important to do it right. But that is trivia and not really important to remember the details of.
Questions of type #3 are very useful, but require someone who themselves is knowledgeable and experienced in the domain. If you don’t have that person (maybe that is why you are interviewing), then either find someone who can temporarily fill in (maybe a consultant) or accept that you just won’t know if they know, and go by references.
Questions of type #3 for a Java GUI designer would maybe be questions covering something like:
a) Layout managers in general - not trivia about each and every one, but what they are, and maybe some of the pitfalls/advantages of a few - the choice of the managers up to the person being interviewed.
b) The proper use of threading (if applicable, and it is getting more relevant every day), SwingWorkers, what should and should not be done on the Swing/AWT Event thread, what should not be done on a background non-Swing thread (hint: don’t manipulate realized Swing components on non-Swing threads).
c) Discuss the MVC concept, how Swing components implement this. If applicable, how would the person scale the model and the view of a JTree or JTable?
d) Maybe the difference between SWT/JFace and Swing/AWT - but unless the job entails the use of SWT/JFace, or they claim the knowledge/experience I would not necessarily expect the person to know much about it.
I could come up with many more if I wanted to, but without writing paragraphs and paragraphs, I could not give you answers to the questions that would really be applicable, and even if I did, you probably wouldn’t be able to judge whether the person being interviewed answered correctly. In this domain, there are usually as many correct answers as there are wrong answers. It takes a person knowledgeable in the domain to understand the difference - and such people won’t be coming here looking for the questions and answers.
Why did I come here? I was googling for a particular type of layout manager to solve a problem, and just thought I would take a few minutes to respond.
Good luck.