swings question

Ads
 

swings question

how to change the background color with the help of color values by using swings

View Answers

July 21, 2011 at 11:26 AM

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

class  SwingFrame {
    public static void main(String[] args) 
    {
        JFrame f=new JFrame();
        f.setLayout(null);
        JLabel lab=new JLabel("Name:");
        JTextField text=new JTextField(20);

        lab.setBounds(20,20,100,20);
        text.setBounds(120,20,100,20);

        f.add(lab);
        f.add(text);
        Container con = f.getContentPane();
        con.setBackground(Color.pink); 
        f.setVisible(true);
        f.setSize(400,150);
    }
}

Ads









Related Tutorials/Questions & Answers:
swings question
swings question  how to change the background color with the help of color values by using swings
SWINGS
SWINGS  WHAT ARE THE DIFFERENCES BETWEEN AWT AND SWINGS
Advertisements
JSP & Swings
JSP & Swings  How to integrate jsp and swings
swings for webnms
swings for webnms  if i am expanding node of jtree then i want to collapse previous expanding node of jtree in swings how is it possible
Swings & JSP
Swings & JSP  Hai all, Can we use Swing components in a JSP?? Suppose if we enter details in a swing dialog box..and If we want the result in a JSP..is that possible??? Thank you
Java Swings
Java Swings  I am doing one project on java Swings, in this i have created one jframe where i defined some JButtons and Jcombobox's, here i need to insert one JTable with headers(IN CURRENT JFrame only).pls help me urgently
swings header
swings header   have a string1 it contains 3 parts,for example "123456 service hello" and string2 contains text "change request " like this. and the string3 should contain "123456 +(second string)+ hello" "second string can
swings
swings
swings
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question
Question   When there is an exception in my program how java runtime system handles
Swings and JDBC
Swings and JDBC  Hi.. I am vinay.. I am developing a small application using swings and mysql. I am sending part of the code here.. The problem is i need to update the mysql fields with values which are gettin from dynamiclly
question
question  dear sir/madam my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
question
question  Dear sir i had some typing mistake at previous question so its my humble request to let me know the steps to start the tomcat6 under the tomcat directory
Image Movement using Swings
Image Movement using Swings  How to move image using Swings
how to create frame in swings
how to create frame in swings  how to create frame in swings
Question?
Question?  My question is how to: Add a menu bar to the program with a File menu. In the File menu, add a submenu (JMenuItem) called About. When the user clicks on the About menu item, display a JOptionPane message dialog
java code using swings
java code using swings  code that should be able to enter data of student details using all swings into the access database using jdbc connectivity
An application using swings and vector methods
An application using swings and vector methods   Hi, I want an application in Java swings which uses good selection of Vectors methods
swings window header
swings window header  i have a string1 it contains 3 parts,for example "123456 service hello" and string2 contains "change request " like this. and the string3 should contain "123456 "........." hello" ".........." can
making of dynamic textfields using swings
making of dynamic textfields using swings  How to make dynamic textfields using java swings
another frame by using awt or swings
another frame by using awt or swings  how to connect one frame to another frame by using awt or swings
java swings - JavaMail
java swings  Hi sir,i am doing a project on swings,i don't have any knowledge about the layoutmanagers,so my project is very very burden to me,so plz provide a material to me for understand the layout manager easily,plz help me
How to create form in Swings
How to create form in Swings  How to create registration, login and question form in Java Swing?   Creating different forms in Java Swing - Examples how to create registration form in swing swing login form example
swings - Java Beginners
swings  how to add an image to combobox? i searched for this in google, but i got very difficult programs. i am beginner in java swings . i want a small example to add a image .gif file to combobox list. thank you   Hi
how can we store the encrypted passwaord in swings?
how can we store the encrypted passwaord in swings?   how can we store the encrypted passwaord in swings
Beans in Swings table
Beans in Swings table  Hi Sir/Madam.... I am Trying Develop an Swing from which include an table which displays the data from mysql table and i am adding one Jtextfield in each row in the last column and i want to update
how to add audio clip in swings with event handling
how to add audio clip in swings with event handling  hello dear, i wanna to play audio clip in java program in JFrame in swings by event handling ,it should be like when i click on a button , audio clip should play , plz tell me
please send me the banking data base in swings
please send me the banking data base in swings  sir, please send me how to create the banking data base program in swings

Ads