Jframe equivalent android


I have created two window frame in JAVA using awt and swing package. My Java code is like:

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

public class TopLevelWindow {

private static void createWindow() {
JFrame frame = new JFrame(“Simple GUI”);

//frame.setDefaultCloseOperation(JFrame.EXIT_ON_ CLOSE);
JLabel textLabel = new JLabel(“Hi Ans “,SwingConstants.CENTER);
textLabel.setPreferredSize(new Dimension(300, 100));
frame.getContentPane().add(textLabel, BorderLayout.CENTER);

//Display the window.
public static void main(String[] args) {



Now on executing my code I am getting two window like frame and switching between these two frames.

The same thing I want it to do in Android means

How to create a window like frame in Android.
At a time two frames are there and we easily switch between frame.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>