Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:49:19+00:00 2026-06-09T12:49:19+00:00

I am a total noob to android and really have very hard time understanding

  • 0

I am a total noob to android and really have very hard time understanding some concepts. I also have a little understanding of java swing. I am a bit knowledgeable about java web app using spring mvc. I am using eclipse indigo

This is what happened:

After I successfully created android app named AndroidExer I created a package com.swing.demo and placed the already running swing source code JTextAreaDemo.java (The source is from a tutorial. This is working in pure java). It seems that that android doesn’t recognize swing packages (I don’t know if I understand it correctly, please help me) because I got alot of errors and most of them says <Class name> cannot be resolved to a type. When I check for suggestions, eclipse does not include any suggestion about importing which makes me think that android doesn’t recognize swing.

I tried a bit of research and I found out that android cannot run swing.
can we run java swing and applet on android

My problem is how will I convert the simple swing demo to android. I don’t have any clue where and how to start. I really need help. BTW, the code is for JTextAreaDemo.java is down below:

JTextAreaDemo.java

package com.swing.demo;

import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class JTextAreaDemo extends JFrame implements ActionListener {

   /**
 * 
 */
private static final long serialVersionUID = 5416184196156296457L;
JTextField jtfInput;
JTextArea jtAreaOutput;
String newline = "\n";
public JTextAreaDemo() {
    createGui();
}
public void createGui() {
    jtfInput = new JTextField(20);
    jtfInput.addActionListener(this);
    jtAreaOutput = new JTextArea(5, 20);
    jtAreaOutput.setCaretPosition(jtAreaOutput.getDocument()
            .getLength());
    jtAreaOutput.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(jtAreaOutput,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    GridBagLayout gridBag = new GridBagLayout();
    Container contentPane = getContentPane();
    contentPane.setLayout(gridBag);
    GridBagConstraints gridCons1 = new GridBagConstraints();
    gridCons1.gridwidth = GridBagConstraints.REMAINDER;
    gridCons1.fill = GridBagConstraints.HORIZONTAL;
    contentPane.add(jtfInput, gridCons1);
    GridBagConstraints gridCons2 = new GridBagConstraints();
    gridCons2.weightx = 1.0;
    gridCons2.weighty = 1.0;
    contentPane.add(scrollPane, gridCons2);
}
public void actionPerformed(ActionEvent evt) {
    String text = jtfInput.getText();
    jtAreaOutput.append(text + newline);
    jtfInput.selectAll();
}
public static void main(String[] args) {
    JTextAreaDemo jtfTfDemo = new JTextAreaDemo();
    jtfTfDemo.pack();
    jtfTfDemo.addWindowListener(new WindowAdapter() {

        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    jtfTfDemo.setVisible(true);
}
}

I really need your help. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:49:20+00:00Added an answer on June 9, 2026 at 12:49 pm

    I don’t think you can mix those two. If you want android native app, you need to use Android API than Swing. Here is android documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have to show some operations in Android,,, but Im having some noob problem,
I am a total noob to jQuery and Javascript.. need some help. I have
Total noob to anything lower-level than Java, diving into iPhone audio, and realing from
I'm a total noob when it comes to iPhone development and have been tasked
Just started exploring Cocoa so pretty much a total noob. I've written a very
OK, total noob question, for msysgit on Windows 7, but I have a remote
I'm a total noob at java, but while practicing tonight it occurred to me
So, i'm a total noob with codeigniter but i'm getting by. I have a
I am a total noob on this issue, and I wonder if I have
I'm a total noob to CSS. I have a css file both locally and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.