0% found this document useful (0 votes)
12 views1 page

Prog MCQ3

Uploaded by

harsh bhandarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Prog MCQ3

Uploaded by

harsh bhandarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

import javax.swing.

*;
import java.applet.*;
import java.awt.*;
/* <applet code="ScrollDemo" width=300 height=100></applet> */
public class ScrollDemo extends JApplet {
public void init() {
Container cp = getContentPane();
cp.setLayout(new BorderLayout());
JTextArea ja = new JTextArea();
int v = ScrollPaneConstants.____________________________;
int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
JScrollPane jsp = new JScrollPane(ja, v, h);
cp.add(jsp, BorderLayout.CENTER);
}
}
----------------------------------------------------------------------------------------------------------------------

Q7: Debug the following code and find out which statement contains error.
import java.awt.*;
import java.awt.event.*;
public class MenuDemo extends Frame {
MenuBar mb;
Menu m1, m2;
MenuItem i1, i2, i3, i4, i5, i6;
MenuDemo(String s) {
super(s);
mb = new MenuBar();
setMenuBar();
m1 = new Menu("File");
m2 = new Menu("Edit");
i1 = new MenuItem("New");
i2 = new MenuItem("Open");
i3 = new MenuItem("Exit");
i4 = new MenuItem("Cut");
i5 = new MenuItem("Copy");
i6 = new MenuItem("Paste");
m1.add(i1);
m1.add(i2);
m1.add(i3);
m2.add(i4);
m2.add(i5);
m2.add(i6);
mb.add(m1);
mb.add(m2);
setSize(500, 500);
}
public static void main(String args[]) {

You might also like