How to change background color in Android application?

How do I change java text?

  • this is how I have my layout import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JMenuBar; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.event.ActionEvent; import javax.swing.text.BadLocationException; import javax.swing.GroupLayout.*; /* Frame.java requires no other files */ public class Frame { /** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ private static void createAndShowGUI() { //Create and set up the window. JFrame frame = new JFrame("Word Editor"); JPanel panel=new JPanel(); JTextArea jt= new JTextArea("Welcome",5,20); frame.add(panel); panel.add(jt); frame.setSize(200,200); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EX… //Create the menu bar. Make it have a Grey background. JMenuBar greyMenuBar = new JMenuBar(); greyMenuBar.setOpaque(true); greyMenuBar.setBackground(new Color(235,234,211)); greyMenuBar.setPreferredSize(new Dimension(200, 20)); //Create a yellow label to put in the content pane. JLabel yellowLabel = new JLabel(); yellowLabel.setOpaque(true); yellowLabel.setBackground(new Color(248, 213, 131)); yellowLabel.setPreferredSize(new Dimension(100,100)); //Set the menu bar and add the label to the content pane. frame.setJMenuBar(greyMenuBar); frame.getContentPane().add(yellowLabel, BorderLayout.CENTER); // Define and add two drop down menu to the menubar JMenu fileMenu = new JMenu("File"); JMenu editMenu = new JMenu("Edit"); greyMenuBar.add(fileMenu); greyMenuBar.add(editMenu); // Create and add simple menu item to one of the drop down menu JMenuItem newAction = new JMenuItem("New"); JMenuItem openAction = new JMenuItem("Open"); JMenuItem exitAction = new JMenuItem("Exit"); JMenuItem saveAction = new JMenuItem("Save"); JMenuItem cutAction = new JMenuItem("Cut"); JMenuItem copyAction = new JMenuItem("Copy"); JMenuItem pasteAction = new JMenuItem("Paste"); fileMenu.add(newAction); fileMenu.add(openAction); fileMenu.add(saveAction); fileMenu.addSeparator(); fileMenu.add(exitAction); editMenu.add(cutAction); editMenu.add(copyAction); editMenu.add(pasteAction); editMenu.addSeparator(); //Display the window. frame.pack(); frame.setVisible(true); } public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(n… Runnable() { public void run() { createAndShowGUI(); } }); } } How do I change the text area location to center and make the white area larger. also how do ?I change the icon in the corner

  • Answer:

    computer

dbunnfly at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.