12 IP QAnswer
W
Description
IP Questions an Answers
Document Sample


Computer Networking
(Q.) What is MAC address.
(1 Mark)
(Ans) MAC address refers to the physical address assigned by NIC manufacturer.
(Q.) What is a protocol?
(2 Marks)
(Ans) A protocol is a set of rules that the computers use to communicate with each other across a network.
(Q.) What is an IP address?
(2 Marks)
(Ans) An IP address (Internet Protocol Address) is a logical address of a network address. It is unique and
identifies computers on a network.
(Q.) Differentiate between LAN and Internet.
(2 Marks)
(Ans) LAN is confined to one or a nearby building. However, Internet has no geographical area and is the
collection of different LANs. Internet is an example of WAN.
(Q.) Define “Denial of Service”.
(2 Marks)
(Ans) A “Denial of Service” (DoS) attack is the attack where the attacker tries to make some resource too
busy to answer legitimate requests or to deny legitimate user’s access to your machine.
(Q.) Write two advantages of Bus Topology.
(2 Marks)
(Ans) a) Short cable length: as there is a single common data path connecting all nodes.
b) Easy to extend: additional nodes can be connected to an existing bus network at any point along its length.
(Q.) Define the following terms:
a) Packet b) Token c) Node (3 Marks)
(Ans) a) Packet: A packet is one unit of binary data capable of being routed through a computer network. To
improve communication performance and reliability, each message sent between two network devices is
often subdivided into packets by the underlying hardware and software.
b) Token: In networking, a token is a special series of bits that travels around a token-ring network. As the
token circulates, computers attached to the network can capture it. The token acts like a ticket, enabling its
owner to send a message across the network. There is only one token for each network, so there is no
possibility that two computers will attempt to transmit messages at the same time.
c) Node: A node is any device connected to a computer network. Nodes can be computers, personal digital
assistants (PDAs), cell phones, or various other network appliances. On an IP network, a node is any device
with an IP address.
(Q.) Write five advantages of fibre optics.
(3 Marks)
(Ans) 1) Fibre optic cables are very small and light.
2) They are highly suitable for harsh industrialenvironments.
3) These cables have very high bandwidth.
4) Guarantees secure transmission and have a veryhigh transmission capacity.
5) They are immune to electrical and magneticinterference.
(Q.) Give three advantages and two disadvantages of Ring Topology.
(3 Marks)
(Ans) Advantages of Ring Topology:
1. Short cable length.
2. No wiring closet space required.
3. Suitable for optical fibres.
Disadvantages of Ring Topology:
1. Node failure causes network failure.
2. Difficult to diagnose faults.
3. Network reconfiguration is difficult.
(Q.) Differentiate between gateway and router.
(3 Marks)
(Ans) Gateway: A gateway is a network device which allows different electronic networks to talk to Internet
that uses TCP/IP.
Router: A router is a device in computer networking that forwards data packets to their destinations, based
on their address.
(Q.) Define
a) Intrusion detection system.
b) Snooping.
(4 Marks)
(Ans)
a) Intrusion detection system
This system examines the traffic on a network for signs of unauthorised access or attacks in progress, while
host-based systems look at processes running on a local machine for an activity that an administrator has
defined as “bad.”
b) Snooping
Snooping is unauthorised access to another person’s or company’s data. Malicious hackers frequently use
snooping techniques and equipments such as key-loggers to monitor keystrokes, capture passwords and
login information and to intercept e-mail and other private communications and data transmissions.
(Q.) Give two advantages and two disadvantages of the following network topologies:
a) Star
b) Tree
(Ans)
Advantages of Star Topology are:
1. One device per connection.
2. Easy to access.
Disadvantages of Star topology are:
1. Long cable length.
2. Central node dependency.
Advantages of Tree Topology:
1. Easy to extend.
2. Fault isolation is easy.
Disadvantages of Tree Topology:
1. Dependent on the root computer.
2. Complex access protocols.
(Q.) Describe modem. What is its function?
(4 Marks)
(Ans)
A modem is a computer peripheral that allows connection and communication with other computers via
telephone lines.
Modem converts digital signals to (A/F) Audio Frequency tones which are in the frequency range that the
telephone lines can transmit and also it can convert transmitted tones back to digital information. In other
words, it changes the digital data from your computer into analog data, a format that can be carried over
telephone lines. It receives the call then changes the analog signal back into digital data that the computer can
understand.
(Q.) Define the term Network Topology. Describe any two topologies.
(4 Marks)
(Ans)
A Network Topology describes the layout of the wire and devices as well as paths used by data transmissions.
The two topologies are:
1.Star Topology
-to-point connection between the deviceand hub.
implemented.
2.Bus or Linear Topology
All devices attach to same transmission medium.
Medium has a physical beginning and end.
Bus considered a multipoint system as all devices tap into same backbone cable.
Open Source Concepts
(Q.) Explain the term ISCII in detail.
(1 Mark)
(Ans)
ISCII is a coding scheme for representing various writing systems of India. It is an 8-bit encoding.
• It retains all ASCII characters and offers coding for Indian scripts also.
• The supported scripts are : Assamese, Bengali, Devanagri, Gujarati, Gurumukhi, Kannada, Malayalam, Oriya,
Tamil and Telugu.
(Q.) What do you mean by the term open source software?
(1 Mark)
(Ans)
Open source software is the software which can be used, studied, modified and redistributed and whose
source code is available. It may or may not be chargeable.
(Q.) What do you mean by free software?
(1 Mark)
(Ans)
Free software is the software without a charge ,which can be used, studied, modified and redistributed as well
but whose source code Is not available.
(Q.) Explain the term ODF.
(1 Mark)
(Ans)
Open Document Format(ODF) is an open, XML-based file format for office documents(textdocuments,
spreadsheets, drawings, presentations and many more). It is an open standard,supported by OASIS, IEC and
ISO.
(Q.) Expand the term: SDLC.
(1 Mark)
(Ans)
Software Development Life Cycle.
(Q.) What is MySQL software used for?
(1 Mark)
(Ans)
MySQL is an open source, multithreaded, multiuser,SQL relational database server.
(Q.) What do you mean by the term Ogg Vorbis?
(2 Marks)
(Ans)
Ogg Vorbis is an audio compression format which iscompletely open, patent free, professional audioencoding
and streaming technology with all thebenefits of Open Source.
(Q.) Vaibhav is confused between GNU and Unix. Is there any difference between the two or are they
same? Explain GNU in brief.
(2 Marks)
(Ans)
The acronym for GNU is GNU is Not Unix. GNU’sdesign is Unix-like, but differs from Unix bybeing free
software and containing no Unixcode. It includes wide range of software,including applications apart from
operating systems.
(Q.) Explain the advantages of Open Standards.
(2 Marks)
(Ans)
The advantages of Open Standards are:
files of their choice.
2. Application and platform independence ensure access to resources independent of any application or
platform.
3. No hidden information content of the file is completely transparent.
4.Diversity and interoperability in the industry enables businesses and people to opt for any technology of
their choice as per their needs.
5.Offers diverse choices for users developers can choose the fastest and most capable hardware systems to
execute their applications and services.
(Q.) What do you mean by the term standard? What are the different types of standards?
(2 Marks)
(Ans)
A standard is an established set of rules by arecognised body and are widely used across variousplatforms.
The standards can be of the following types:
a. Proprietary Standard: Is a standard for which the user has to buy a license.
b. Open Standard: Is a standard that is publicly and freely available without any restrictions.
(Q.) What are the four kinds of freedom that are required by the users of the free software?
(2 Marks)
(Ans)
The four kinds of freedom that are required by theusers of the free software are as follows:
1. Freedom to run the program, for any purpose
2. Freedom to study how program works and adapt it to our needs
3. Freedom to redistribute copies
4. Freedom to improve program and release new improvements to the public
5. (Q.) Alisha is familiar with the term 'web'. But she does not know about W3C. Explain W3C.
6. (2 Marks)
7. (Ans)
W3C is an acronym for World Wide Web Consortium. It makes the web accessible to allusers. It is
responsible for developing softwarestandards and producing specifications for worldwide web and
the products are freely available toall.
8. (Q.) Write any 5 distribution terms of open source software.
9. (3 Marks)
10. (Ans)
The distribution terms of open source software must comply with the following criteria:
• Free Redistribution: No restriction on selling or giving away of the software. No fee for sale.
• Source Code: Distribution of source code and compiled form. Modifications allowed in the source
code.
• Derived Works: Derived works must be allowed to be redistributed under the same terms.
• Integrity of The Author’s Source Code: Source code can be restricted from being redistributed only
if the license allows the distribution of “patch files” . The license explicitly permits distribution of
modified software.
• No Discrimination Against Persons or Groups: The license must not discriminate against any person
or group of persons.
11. (Q.) Explain shareware in detail.
12. (3 Marks)
13. (Ans)
Shareware is basically “try before you buy” software. It lets us try a program for a period of time
before we buy it. Shareware is not the same as FOSS for the following reasons:
• source code is not available
• modifications to the software are not allowed
14. (Q.) Explain freeware in detail.
15. (3 Marks)
16. (Ans)
Freeware is not to be confused with freesoftware, is a type of proprietary software. It isoffered for
use free of monetary charges andallows copying and distribution, but notmodification and whose
source code is kept secret. It is used in marketing to sell productsand to gain marketing advantages.
17. (Q.) Explain the term ASCII in detail.
18. (3 Marks)
19. (Ans)
ASCII Code(American Standard Code for Information Interchange) :
• Is the most widely used alphanumeric code
• Represents text in computers, communications equipment and other devices that uses text
• Used in microcomputers, minicomputers and mainframes
• ASCII code is a 7-bit code i.e., 27= 128 character values
20. (Q.) What is a font? Write the advantages and disadvantage of OTF?
21. (4 Marks)
22. (Ans)
23. A font refers to a collection of characters(letters, numerals, symbols and punctuation marks). Fonts
that are selected affect the printing of the document.
24. Advantages of Open Type Font:
• Larger glyph limit(64K)
• Cross-platform support(Win and Mac)
• Support for both PostScript Type 1 or True Type outlines
• Support for typographic features
Disadvantage of Open Type Font:
• Not all applications support the extended features
25. (Q.) Explain the term Indian Language Computing. What is the significance of Unicode in
Indian Language Computing?
26. (4 Marks)
27. (Ans)
Indian language computing involves developing software in Indian scripts/ languages. The users are
segregated into different language speaking communities which creates a fragmentation in the
market. Significance of Unicode:
• Provides a unique number for every character
• Widespread industry support provides platform and vendor independence. e.g., HP, Microsoft, IBM,
Sun, Oracle
• Internet ready for use in E-business. e.g., Internet standards such as XML, Perl, Java and JavaScript
• Text in any language can be exchanged worldwide. That is, it eliminates data corruption and other
problems due to incompatible code pages or missing conversion tables.
• Processing text in one way reduces development and support costs, improves time-to-market, and
allows for single version of source
28. (Q.) What are the types of Indian Language Text Typing? Explain.
29. (4 Marks)
30. (Ans)
31. The two types of Indian Language Text Typing are:
• Phonetics Text Entry
• Keymap Based Text Entry
Phonetics Text Entry:- Phonetics Text Entry is also known as transliteration.
• Traditional keyboards with English keys are used
• Indian alphabets are written the way they sound
• Combination of texts represents one Indian language character. e.g., gmail, orkut etc.
Keymap Based Text Entry:
• Refers to mapping of keyboard’s keys to character
• Entire arrangement of keymappings of all the characters on a keyboard is known as keymap. e.g., if
we press a key horizontally adjacent to CapsLock on the keyboard, the letter “a” gets typed
Java GUI Programming Revision Tour – I
(Q.) The do-while loop is an exit-controlled loop. Explain?
(1 Mark)
(Ans)
The do-while loop is an Exit-controlled loop because it evaluates its test-expression at the bottom of the loop
after executing its loop-body statements.
do { statement ;
} while (test-expression);
(Q.) What is a character set?
(1 Mark)
(Ans)
Character set is a set of valid characters that a language can recognize. A character represents any letter, digit
or any other sign. Java uses Unicode character set.
(Q.) Describe the relationship between properties, methods and events.
(1 Mark)
(Ans)
If we take an object, then properties can be thought of as an object’s attributes, methods as its actions and
events as its responses.
(Q.) What are the characteristics of Java?
(1 Mark)
(Ans)
Some important characteristics of Java are:
Write Once Run Anywhere (WORA)
Light Weight
Security
Built-in Graphics
Object-Oriented Language
Supports Multimedia
Platform Independent
Open Product
(Q.) How does while loop execution occur?
(1 Mark)
(Ans)
The while loop execution first examines the condition. If the condition is true, then it executes the statement,
again the condition is checked. As long as the condition is true, it will keep executing the statement.
Q.) What are Literals. Name the literals allowed in Java.
(1 Mark)
(Ans)
Literals are data items that never change their value during a program run. Java allows following literals:
integer-literal (decimal, octal, hexadecimal), character-literal, floating-literal and string-literal.
(Q.) What does a break statement do?
(1 Mark)
(Ans)
A break statement terminates the current loop and proceeds to the first statement that follows that loop.
(Q.) What is a “fall through”?
(1 Mark)
(Ans)
The term “fall through” refers to the way the switch statement executes its various case sections. Every
statement that follows the selected case section will be executed unless a break statement is encountered.
(Q.) What are operators? Name them.
(1 Mark)
(Ans)
Operators are special symbols that perform a particular function on operands. There are five types of
operators: arithmetical, logical, comparison, assignment and bitwise operators.
(Q.) What is the value of i and j in the two cases given below:
a) i=7
j= i ++
b) i=8
j= --i
(1 Mark)
(Ans)
a) Here, j=7. First j=i++ will be evaluated and then the value of i will increase. So, i=8.
b) Here, j=7. First the value of i will decrease, then it will be assigned to j. So, i=7, j=7.
(Q.) What is an IDE? Give Example.
(1 Mark)
(Ans)
IDE or Integrated development Environment is a programming environment consisting of a code editor, a
compiler, a debugger and a graphical user interface builder.
Example: NetBeans and Borland JBuilder.
(Q.) What are Binary and Unary Operators?
(2 Marks)
(Ans)
Binary operators require two operands to operate upon. The examples are: Addition operator, Subtraction
operator, Multiplication operator, Division operator and Modulus operator.
Unary operators act on one operand. Some examples are: ++ Increment Operator and --decrement operator,
&& Address operator, * Indirection operator, + unary plus, - unary minus, ! logical negation, _bitwise
compliment.
(Q.) What is String? Explain with an example.
(2 Marks)
(Ans) A String is one or more characters considered as a single value. Everything entered in a program,
requested from the user or displayed as a series of characters is known as a String. We can declare a variable
in Java using String data type. Strings in Java are 16-bit Unicode. Example: String Name= “Miss. Ritu Kumar”;
(Q.) How is event handler access in NetBeans IDE? (2 Marks)
(Ans) Java supports number of event handlers for each and every control. The event handlers can be
accessed either through right click Event option or through Properties window.
(Q.) What is a container? Name few examples.
(2 Marks)
(Ans) Container is an AWT class. This class is derived from AWT component and it is the basis of AWT
containers which can hold other components. Example: JFrame, JApplet and JDialog are container classes.
(Q.) What is GUI Builder? What is the difference between source view and design view?
(2 Marks)
(Ans) GUI Builder
Also called Design Area or Design Space
Primary workspace within which GUI Design takes place in the IDE
It has two views: Source view, and Design view
Source View: Opens the code editor
Design view: Opens the GUI Builder
(Q.) What is byte code?
(2 Marks)
(Ans) The Java Byte Code is a machine instruction for a Java processor chip called Java virtual machine.
The byte code is independent of the computer system it has to run upon.
Java programs are compiled and their byte codes are produced. The byte codes are always exactly the same
irrespective of the computer system they are to execute upon.
(Q.) How can we remove a control from the frame/window?
(2 Marks)
(Ans)
To Remove a Control from the Frame/window:
There are two ways to delete a control
OR
right click, a context menu appears
(Q.) Explain the terms:
(a) Character Constant
(b) String Literal
(2 Marks)
(Ans) a) Character constant must have
(i) One character
(ii) It should be enclosed within single quotationmarks, Example: ‘g’,‘y’, ‘n’, ‘a’, etc.
b) String Literal is a sequence of characters surrounded by double quotes. It, by default, terminates with a
special character ‘’ which is a string character.
E.g., “Computer Science” is a string literal and it terminates as “Computer Science�”.
(Q.) Explain the significance of import statement in following statement:
import javax.swing.JOptionPane;
(3 Marks)
(Ans) JOptionPane class is defined in javax.swing package. To utilize this class method, we must import it by
using import, i.e.,
Import javax.swing.JOptionPane;When this line is processed by compiler, the import statement is used by
compiler to identify and load classes required for compiling a program. Here, JOptionPane is a class from the
javax.swing package.
(Q.) How is numeric data converted into String data?
(3 Marks)
(Ans) The toString() method is a special method that can be defined in any class. toString() method converts
a Boolean value to a string, this method should return a String argument. Java uses toString() method to
convert numeric data into String data.
When using toString() method without argument, the toString() method accepts an optional numerical
argument. When no argument is passed, toString() simply returns the base 10 representation of the number
on which it is applied.
(Q.) What is NetBeans IDE? What are the components of NetBeans IDE?
(3 Marks)
(Ans) NetBeans IDE is a free, open-source, cross-platform IDE (Integrated Development Environment) with
built-in support for Java Programming Language. It offers many features for application development, such
as:
Drag–and-drop GUI creation
Excellent editing (advanced source code editor)
Web services
Excellent debugging
Wizards, code generation and management tools.
Components of NetBeans: Various components of NetBeans are:
Title Bar, Tool Bar, Menu Bar and Pull-down Menus
GUI Builder: Primary workspace within which GUI Design takes place in the IDE.
The Palette: It contains all the components needed to create GUI Applications.
Frames: A frame is a window that has decorations such as a border, a title and buttons for closing and
iconifying itself.
Controls: Controls are component objects such as text fields, labels, list boxes, etc. that are drawn on
frame to get data input or to display output.
Inspector Window: This window displays a tree hierarchy of all components contained in the currently
opened form.
Properties Window: This window displays the editable settings for the currently selected component.
Code Editor Window:We write Java code for our application in code editor window. A separate code
editor window is created for each top level frame that we create in our application.
(Q.) What does the following line mean:
public class HelloForm extends javax.swing.JFrame
(3 Marks)
(Ans) The above line means that
ass definitions.
Keyword extends followed by a class name indicates the class from which a new class inherits.
(Q.) Write steps to add event handler for Jbutton control.
(3 Marks)
(Ans) Buttons provide the most common event generating components in user interfaces. Clicking on the
button should initiate some action. Java supports number of event handlers.
Steps to add event handler are as follows:
1. Go to Design view and click the button that has been created.
2. Right-click and choose Events-> Action-> Action Performed
Or
Click Event tab in Properties window which shows the available events for Jbutton control.
The task of actionPerformed () is to process a user’s interaction with GUI component that generates an action
event.
(Q.) Define the terms:
Event
Component
Widget
(3 Marks)
(Ans)
Event: An event refers to the occurrence of an activity. Events can occur through user actions, such as a
mouse click or a key press , through programming control or even as a result of another window’s actions.
Component: A component is an object that defines a screen element, such as a push button, text field, scroll
bar, menu bar, etc.
Widget: It stands for window gadget. A control with visual properties, which can display information and
interact with user.
(Q.) What is wrong with following while loop?
int number = 1
while(number<100)
System.out.println(number);
number++;
(4 Marks)
(Ans)
The above loop is an infinite loop, because in the absence of any block statement, single statement is
considered as the body of the loop. In the above code, the body of the loop consists of only one statement
which is System.out.println (number);. The value of control variable number is not being updated inside the
loop-body, hence the loop repeats endlessly. The correct form is as follows:
int number = 1
while(number<100) {
System.out.println(number);
number++;
}
Q.) Name the methods used for text interaction in a GUI. Explain them briefly.
(4 Marks)
(Ans)
There are three types of methods:
1. getText() method
2. parse-----() methods
3. setText() method
getText() method – Obtaining text from a GUI component
Returns the text currently stored in a text based GUI component.
Swing components that support this method are: Text Field, Text Area, Button, Label, Check Box and
Radio button.
To obtain text from Name text field, we write Name.getText().
parse-----() methods- Obtaining numbers from a GUI component
To convert textual data into numeric type, we use parse method.
numeric types.
Example:
Integer.parseInt(String s) converts a string into an int type value
Float.parseFloat(String s) > String into a float type value
Short.parseShort(String s) > String into a short type value
setText() method- Storing text into a GUI Component
Stores or changes text in a text based GUI component.
Swing components that support this method are: Text Field, Text Area, Button, Label, Check Box and
Radio button.
To change text of Name text field to “X”, we write Name.setText(“X”).
(Q.) Write steps to create a project in NetBeans IDE.
(4 Marks)
(Ans)
We can create a new GUI application project. Then, add code to the generated source file. After that, compile
and run the program.
Steps to create a new GUI IDE Project
1. Start NetBeans IDE
2. In the IDE, choose File-> New Project (Ctrl+Shift+N)
3. In the Categories pane, select the Java node
In the Projects pane, choose Java Application
Click Next
4. Enter desired name in the Project Name field and specify the project location
5. Leave the Use Dedicated Folder for Storing Libraries checkbox unselected
6. Ensure that the Set as Main Project checkbox is selected and clear the Create Main Class field
7. Click Finish button.
Now, the NetBeans will create the project folder in the designated location
8. To add a frame window, on the top left pane, under Projects tab, right click on project’s name and
select New. From the submenu, select JFrame Form.
9. Specify the name of the new frame being added in the box next to Class Name and click Finish.
Java GUI Programming Revision Tour – II
(Q.) Brief the use of JComboBox.
(1 Mark)
(Ans)
JComboBox is a component that combines a button or editable field and a drop-down list. The user can select
a value from the drop-down list. If you make the combo box editable, then the combo box includes an editable
field into which the user can type a value.
(Q.) What does a JList fire when a user selects an item?
(1 Mark)
(Ans)
When a user selects an item, the JList fires ListSelection Event. The event Listener used by a JList is
ListSelctionListener.
(Q.) Write a short note on CardLayout Manager.
(1 Mark)
(Ans)
CardLayout provides a means of managing two or more components occupying the same display area. When
using CardLayout, each component is like a card in a deck, where all cards are the same size and only the top
card is visible at any time. Since the components share the same display space, at design time you must select
individual components using the Inspector window, as at design time, only the top most component is visible
in
CardLayout.
(Q.) Name some layout mangers provided by the swing.
(1 Mark)
(Ans)
Swing provides seven different layout managers which are as follows:
• FlowLayout
• BorderLayout
• GridLayout
• GridBagLayout
• SpringLayout
• CardLayout
• BoxLayout
Q.) Define the term container.
(1 Mark)
(Ans)
A container is a component which can contain other components inside it.
(Q.) What does a getPassword() method of a password field returns?
(1 Mark)
(Ans)
The getpassword() method returns the text displayed by the password field.
(Q.) Define the term JCheckBox.
(1 Mark)
(Ans)
JCheckBox is a widget that has two states: On & Off. It is a box with a label. If the checkbox is checked, it is
represented by a tick in a box. A checkbox can be used to show/hide splash screen at startup, toggle visibility
of a toolbar etc.
(Q.) Write the uses of Basic Controls.
(1 Mark)
(Ans)
Swing components are basic building blocks of an application. Swing toolkit has a wide range of various
widgets like buttons, check boxes, sliders, list boxes etc. In short, it has everything that a programmer needs
for his job.
(Q.) Write the uses of Basic Controls.
(1 Mark)
(Ans)
Swing components are basic building blocks of an application. Basic Swing controls are simple components
that are used primarily to get input from the user or to show simple state. These includes -
JButton, JCheckBox, JComboBox, JList, JMenu, JRadioButton, JSlider, JSpinner etc.
(Q.) Brief the concept of Java Swing.
(1 Mark)
(Ans)
Swing API offers rich set of GUI component and functionality for making the enterprise applications. The GUI
component of Swing API offers diffferent varieties of style and functionality.
(Q.) Brief the use of JCheckBox and JPannel.
(2 Marks)
(Ans)
JCheckBox – It provides the check box button. They allow you to select multiple choices.
JPannel – It provides you the radio button. They are option buttons that can be turned on or off.
(Q.) Describe the concept of Labels in java swing.
(2 Marks)
(Ans)
With the JLable class, you can display unselectable text and images. If you need to create a component that
displays a string or an image (or both), optionally reacting to user input, you can do so by using or extending
JLabel. If the interactive component has state, then you should probably use a button instead of a label.
Here's a picture of an application that displays three labels.
The window is divided into three rows of equal height; the label in each row is as wide as possible.
(Q.) Why do we prefer a combobox over a list.
(2 Marks)
(Ans)
A combo box is preferred over a list for these reasons -
(i) It takes less space on screen.
(ii)It offers editing features through a text field.
(iii) Only a single item needs to be selected.
(Q.) Which layout manager is used to display the component in their natural size?
(2 Marks)
(Ans)
When it is required to display component in their natural size, then SpringLayout can be used.
(Q.) Write various swing controls.
(3 Marks)
(Ans)
The various swing controls of java API are:
• Basic Controls: These components are used to get input from the user or to show simple state. For Ex -
JButton, JCheckBox, JComboBOx, JMenu, LSlider etc.
• Interactive Display: These components display that information which is of highly formatted nature and
that can be modified by the user. For Ex - JEditorPane, JtextPane, JFileChooser, JTable etc.
• Uneditable Information display: These component display information to the user and it cannot be
edited. Like JApplet, JDialog, JFrame.
• Top-Level Containers: These are the component, at least one of which must be present in any swing
application. For Ex - JApplet, JDialog, JFrame.
• General Purpose Containers: These are the containers that provide general purpose utility, like JPanel,
JScrollPane etc.
(Q.) Write some common methods of password field.
(3 Marks)
(Ans)
The common methods of password field are:
Method Description
Sets the echo character – the character displayed
void setEchoChar(char)
instead of the actual characters typed by the user.
char getEchoChar() Returns the echo character.
char[] getPassword() Returns the text displayed by the password field.
void selectAll() Select all character in the password filed.
(Q.) Write the steps to create the Radio button.
(4 Marks)
(Ans)
Radio buttons are groups of buttons in which, by convention, only one button at a time can be selected. The
Swing release supports radio buttons with the JRadio Button and ButtonGroup classes. Radio buttons look
similar to check boxes, but, by convention, check boxes place no limits on how many items can be selected at a
time.
The steps to create the Radio Button are:
• Add a container to the application to hold the set of radio buttons.
• Give title border to panel. (It is optional but it is recommended as it works as label for the group of radio
buttons.)
• Add a ButtonGroup to the application by first clicking at button Group control on palette and then dragging
into design space.
• For each selectable option, create a JRadioButton, add it to the container panel which you have selected in
first step and then add it to the button-group you created in third step by setting button Group property to
the radio button.
Related docs
Other docs by dholariyagunjanitechpro
1315315385_MicrosoftWord-CBSE_IX_SummativeAssessmentI_SamplePaper7_Question0
Views: 5 | Downloads: 0
1315314032_MicrosoftWord-CBSE_IX_SummativeAssessmentI_SamplePaper3_Solution_30
Views: 6 | Downloads: 1
Get documents about "