Full Transcript

Sr.No Question Option A Option B Option C Option D Answer 1 Which method can be used display() print() drawString() transient() c to output a string in an ap...

Sr.No Question Option A Option B Option C Option D Answer 1 Which method can be used display() print() drawString() transient() c to output a string in an applet 2 AWT stands for? All window Toolkit Abstract window Toolkit All writing Tools All windows Tools b 3 Which of these events WindowEvent ActionEvent KeyEvent ActionEvent b generated when a button is pressed 4 AWT Viewer tool is available bin Lib Source class a in which of the folder of JDK 5 Return type of Void void String string b setAlignment()? 6 Method use to change the getPoint() translatePoint() getClickCount() isPopupTrigger() b location of event? 7 What is return type of int void boolean String b actionPerformed(ActionEven t e) 8 Return type of int boolean float void d itemStateChanged(ItemEve nt ie) 9 Types of dialog Boxes? Nodal & Nodeless Model & Modeless Modal & Nodal Both a & b b 10 Constructor of Dialog? A and B only C A and C only A c A.Dialog(Frame parentwindow,boolean mode) B.Dialog(Frame parentwindow,String title) C.Dialog(Frame parentwindow,String title,boolean mode) 11 which dialog box is active Model Modeless Both a and b none of these b and input focus can be directed to another window in the program. 12 In the constructor Model Modeless Both a and b none of these a Dialog(Frame paretnwindow,boolean mode) the parentwindow, is the owner of the dialog box.If mode is true then dialog box is? 13 Dialog(Frame Model Modeless Both a and b none of these b paretnwindow,boolean mode) the parentwindow, is the owner of the dialog box.If mode is false then dialog box is? 14 When dialog box is closed exit() close() closed() dispose() d which method is called? 15 How many constructors are 2 3 4 5 b present in FileDialog? 16 Method provided by I and ii iv iii I,iii a FileDialog()? i. String getDirectory() ii.String getFile() iii.String getDirectoryName() iv. Only iii 17 AWT is Platform dependent Platform independent both a and b none of these a 18 Swing is Platform dependent Platform independent both a and b none of these b 19 Swing uses for running GUI Applet JApplet Both a and b none of these b application? 20 MVC stand for? Model view controller Model viewer controller Modeless view controller Modeless viewer a controller 21 MVC architeccture has 3 Model view controller Viewer View Controller a major parts, which is the bottom most level of the MVC architecture 22 getContentPane() has return int String container void c type? 23 How many constructors of 2 3 4 5 a icons present? 24 ImageIcon class Icon class Icon Interface Image class Image Interface b implements? 25 int getIconHeight() returns inches centimeter pixels milimeter c the height of the icon in? 26 return type of getIcon()? string void Icon int c 27 return type of getText()? string void Icon int a 28 return type of setIcon(Icon string void Icon int c i)? 29 Return type of setText(String string void Icon int b s)? 30 JLabel(String s,Icon i,int LEFT,RIGHT,CENTE EAST,WEST,NORTH,S TOP,BOTTOM,CENTER RIGHT,LEFT,CENTE a align) the align argument R,LEADING,TRAILIN OUTH R,TOP,BOTTOM can be G 31 How many constructors are 2 3 4 5 c of JTextField? 32 setSelectedIcon(Icon i) has void int Icon boolean a return type? 33 ________is a superclass for Button AbstractButton ScrollButton None of these b push button,checkboxes and radiobutton 34 Constructor of JButton i,ii,iii i,ii,iv,v i,ii,iv all of these c class? i.JButton(Icon i) ii.JButton(String s) iii.JButton(String s,Icon i) iv.JButton(Image j) v.JButton(String s,Icon i,Image j) 35 Return type of void int string boolean a removeActionListener(Action Listener el) 36 return type of void int string boolean a setRolloverIcon(Icon i) 37 CheckBox state can be void boolean void setselected(Boolean boolean c changed by which method? vgetSelected(Boolean getSelected(Boolean state) setSelected(Boolean state) state) state) 38 __are known as option Button RadioButton Both a and b None of these b button as you can select only one option or button at a time in a given group of options. 39 return type of void string boolean int a addItem(Object obj) 40 Which constructor JList() JList(ListModel Jlist(Object[] list data) Jlist(vector ListData) d constructs a Jlist that dataModel) displays or views the elements from a particular vector. 41 which method returns the SetSelectedIndex GetSeletedIndex() GetSelectedValue() SetSelectedValue() b selected index and it returns -1 if no item is selected? 42 Which method returns the SetSelectedIndex GetSeletedIndex() GetSelectedValue() SetSelectedValue() c first selected value or display null if nothing is selected 43 Which layout aligns BorderLayout CardLayout GridBagLayout GridLayout c components horizontally and vertucally and the components can be of different sizes 44 Which component cannot be Jpanel Jbutton Jframe Jcomponent c added to a container? 45 Swing components that don't Lightweight Heavyweight GUI component non-GUI component a rely on native GUI are component Component referred to as 46 Which layout manager Flow Layout Grid Layout Border Layout Any Layout b should you use so that every component occupies the same size in the container? 47 Suppose a Jframe uses the 1 2 3 4 c GridLayout(2,0) If you add six Buttons to the frame how many columns are displayed? 48 The Method_____ sets the SetBackground(Color. f.SetBackground(Color. f.setbackground(color.yell setbackground(color. b background color to yellow yellow) YELLOW) ow) yellow) in Jframe f 49 To specify a font to be bold Font.PLAIN Font.ITALIC Font.BOLD Font.BOLD+Font.ITA d and Italic, use the font style LIC value 50 You can use SetForeground SetBackground SetFont SetLayout a,b,c method_______ on any instance of java.awt.component 51 ______can be used to enter Label Button Checkbox TextField d or display a string 52 The method jlbl.setText("Result") jlbl.newText("result") jlbl.text("Result") jlbl.findtext() a _________assign the name result to the Text of variable jlbl. 53 Which method will be KeyPressed() KeyReleased() KeyTyped() KeyEntered() c invoked if a character is entered? 54 Which of these is a super Applet Event ComponentEvent InputEvent a class of all adapter class? 55 Which method used to getPoint() GetCoordinates() GetMouseXY() GetMouseCoordinat a obtain co-ordinates of a es() mouse 56 Which of these is a super WindowEvent ComponentEvent ItemEvent InputEvent b class of all ContainerEvent class? 57 Which of these class is EventObject EventClass AcctionEvent ItemEvent a super class of all events? 58 ____component can be AWT Swing both a and b none of these b given their own look and feel 59 For creating a Button having Jbutton(String str) Jbutton(Icon i) Jbutton(String str,Icon i) Jbutton() a label which constructor is used? 60 To use Swing java.Swing javax.Swing java.awt javax.awt b components_____ package is used 61 ____ is the default layout Flow Laout Grid Layout Border Layout Card Layout a manager for Panel or Applet 62 isModal() is the return type? int boolean void string b 63 The arc is drawn negative,positive negative,negative positive,positive positive,negative d counterclockwise if sweepAngle is _______ and clockwise if sweepAngle is________ 64 Return type of getRGB()? color void int boolean c 65 Return type of color void int boolean b setColor(Color newcolor) 66 return type of getColor() color void int boolean a 67 Which methodd returns the String getName() String SetName() String getFontName() String c face name of the invoking setFontName() font? 68 ____is a superclass of WindowEvent ComponentEvent ItemEvent InputEvent b windowEvent class 69 Which of these package java.lang java.awt java.awt.event java.event c contains all the event handling interfaces? 70 _____ interface define a Component Listener Container Listener Action Listener Item Listener d method itemStateChanged() 71 Name of event classes? ActionEvent,Compone ContainerEvent,FocusE ItemEvent,KeyEvent All of these d ntEvent vent 72 Event object class belongs java.util java.awt java.lang java.sql a to 73 _____method is defined in MouseDragged() MousePressed() MouseReleased() MouseClicked() a mousemotionAdapter class 74 AWT classes can be roughly GUI components Layout Graphics tools All of these d categorized into the following groups 75 Which of these constant BLOCK_DECREMEN BLOCK_INCREMENT UNIT_DECREMENT UNIT_INCREMENT d value will change when the T button at the end of scrollbar was clicked to increase its vvalue? 76 Which constant of window WINDOW_CLOSED WINDOW_CLOSING WINDOW_ACTIVATED WINDOW_DEACTIV b Event class makes a request ATED for closing window 77 ____encapsulate aa blank Panel Canvas ComponentEvent Container b window upon which you can draw 78 ____component allows us to JTextField JTextArea Both a and b none of these a enter/edit a single line of text 79 _____component is used to JTextField JTextArea Both a and b none of these b accept several lines of text from the user 80 A ____ is a component that JComboBox JScrollPane JTabbedPane Jtree c appears as a group of folders in a file cabinet. Each folder has a title 81 A____ is a component that JComboBox JTabbedPane JScrollPane Jtree c presents a rectangular area in which a aomponent may be viewed. 82 ____ is a combination of JComboBox JTabbedPane JScrollPane Jtree a textfield and drop-down list that lets user either type in a value or select it from a list that is displayed when the user asks for it. 83 _____ class,unlike its AWT JComboBox Jlist Jtree JTabbedPane b counterpart is capable of displaying not just the string but also icons. 84 Default Layout for Frame FlowLayout BorderLayout GridLayout Card Layout b 85 Default Layout for Jframe FlowLayout BorderLayout GridLayout Card Layout b 86 Default layout for Applet FlowLayout BorderLayout GridLayout Card Layout a 87 Default Layout of Japplet FlowLayout BorderLayout GridLayout Card Layout b 88 Button class implements AdjustmentListener ItemListener ActionListener MouseListener c ____ListenerInterface 89 CheckBox class ItemListener ActionListener MouseListener AdjustmentListener a implements____Listener 90 ScrollBar implements____ AdjustmentListener MousseListener ItemListener WindowListener a 91 For which Interface method ObjectListener AdjustmentListener ActionListener ComponentListener b belongs to void adjustmentValueChanged(A djustmentEvent e) 92 BorderLayout consist of 5 4 3 2 a ___static data members 93 To layout the component in 3 CardLayout FlowLayout GridLayout BorderLayout c dimensional array ____ layout is used 94 What is return type of Color Int Long Float a getRed(), getGreen() and getBlue() 95 Return type of setTitle() void int String Object a 96 return type of setVisible() void Int String Object a 97 ____class is at top of AWT container Component window Panel b hierarchy 98 ___is the return type of void boolean String TRUE b isBold() method of FONT class 99 ____is the return type of String Font void int a getLabel() method of Button class 100 getActionCommand () Action Event Adjustment Event Item Event window Event a method belongs to which class 101 ___return type of void string Checkbox int a setSelectedCheckBox() 102 ___is the return type of String int void object a getSelectedItem of choice class 103 ___ is the return type of int void string boolean a getSelectedIndex() of choice control 104 return type of int void string boolean a getItemCount() 105 For which class this constant scrollbar menubar filedialog actionevent a belongs to BLOCK_DECREMENT and BLOCK_INCREMENT 106 ActionEvent belongs to ___ Button List Menu All of these a class 107 addTab() belongs to JTabbedPane JScrollBar Jlist All of these a 108 return type of getPath() String int TreePath float c 109 DefaultMutableTreeNode TreeSelectionListener MutableTreeNode both a and b none of these b implements which interface 110 return type of getIcon()? string int Icon char c 111 JToggleButton implements AbstractButton Button Jbutton none of these a which interface 112 Which method is called to getItem() getText() getSelectedItem() none of these c obtain a reference to the JCheckBox object that generate the event 113 In swing Radio Button CheckBoxGroup Jbutton ButtonGroup none of these d created using 114 What does the following line A. Creates the A. Creates text A. Creates text object A. The code is b of code do? TextField object text and object that can hold 10 that can hold 10 rows of illegal t=new TextField(10); initializes it with the columns of text text value 10 115 1. The setBackground() Container Applet Object Graphics d method() is a part of the following class in java.awt package: 116 1. Which of the following hode() disappear() remove() delete() c methods can be used to remove java.awt.Componenr object from display? 117 What are controls or compone a. Controls or a. Controls or a. Controls or a. Controls or a components allow components do not components allow users components allow users to interact with allow users to interact to interact with users application to application with users interact with user 118 What are the subclasses of a. Windows, a. ScrollPane, a. Thread, Vector, a. Thread, a the Container class? Panel, ScrollPane Vector, String String Vector, String 119 Which object is needed to A. CheckboxGroup checkbox RadioButton TextField a group Checkboxes to make them exclusive? 120. Which class can be used to A. MenuBar MenuItem CheckBoxMenuItem Menu c represent the Checkbox with a textual label that can appear in a menu? 121 Which are various AWT Labels, Push buttons, A. Text components, A. Labels, Strings, JSP, A. Push buttons, a controls from following? Check boxes, Choice Threads, Strings, Netbeans, Sockets Servelts, Notepad, lists Servelts, Vectors JSP 122 JPanel and Applet use FlowLayout Grid Layout Border Layout GridBagLayout a ___________________ as their default layout 123. Which of these methods setIcon() getText() setLabel() setBordeLayout() d cannot be called on JLabel object? 124. _____________ pane GlassPane ContentPane Container All of above b can be used to add component to container 125 What is the purpose of A. JTable object A. JTable object A. JTable object JTable object c JTable? displays rows of data. displays columns of displays rows and displays data in Tree data. columns of data. form 126 Which method is used to A. rollOverIcon( A. setIcon(ImageIcon A. A. removeIcon b display icon on a ImageIcon i) i) displayIcon(ImageIcon i) (ImageIcon i ) component? 127 Which of these events is ComponentEvent ) ContainerEvent ) FocusEvent ) InputEvent a generated when the size operating system an event is changed? 128 Which of these events is ComponentEvent ) ContainerEvent ) FocusEvent ) InputEvent b generated when the component is added or removed? 129 Which of these are integer COMPONENT_HIDD COMPONENT_MOVED COMPONENT_RESIZE all of these d constants of EN ComponentEvent class? 130 Which of these events is Component Event Container Event Focus Event ) Input Event c generated when computer gains or losses input focus? 131 Which of these methods is display() print() drawString() transient() b a part of Abstract Window Toolkit (AWT)?

Use Quizgecko on...
Browser
Browser