Hey, I need some assistance with an assignment that deals with Jframes. The assignment says "For questions 27 to 31, consider the following class:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class A extends JFrame
   private Container c;
   private JButton b;
   private JTextField tf;

Now for the questions:
29.Inside the constructor, this code instantiates the text field tf; after instantiation, the text field should be empty but have space for 10 characters.

30.Inside the constructor, and assuming that c has been assigned the content pane. this code sets the layout manager of the content pane to a 2-by-1 grid layout manager.

This is what I have for question 29:

tf = new JTextField(10);

I am not sure how to do quesion 30 though. Any tips would be wonderful!

4 Years
Discussion Span
Last Post by stultuske

you haven't finished question 29 neither. what exactly is it you are having trouble with?
just check the api's of those classes and look at which actions (methods) you can perform on them. the rest can be easily googled.


Use Gridlayout

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.