/* <applet code=palette height=600 width=600>
</applet> */
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class palette extends Applet implements ActionListener,ItemListener
{
Button[] colors;
Checkbox foreground,background;
TextArea workarea;
CheckboxGroup cbg;
Panel buttonpanel,checkpanel,palettepanel;
String colour;
public void init()
{
buttonpanel=new Panel();
buttonpanel.setLayout(new GridLayout(3,3));
colors=new Button[9];
colors[0]=new Button("RED");
colors[1]=new Button("GREEN");
colors[2]=new Button("BLUE");
colors[3]=new Button("CYAN");
colors[4]=new Button("ORANGE");
colors[5]=new Button("WHITE");
colors[6]=new Button("BLACK");
colors[7]=new Button("YELLOW");
colors[8]=new Button("PINK");
for(int i=0;i<9;i++)
{
colors[i].addActionListener(this);
buttonpanel.add(colors[i]);
}
checkpanel=new Panel();
checkpanel.setLayout(new FlowLayout());
cbg=new CheckboxGroup();
foreground=new Checkbox("ForeGround",cbg,true);
background=new Checkbox("BackGround",cbg,false);
foreground.addItemListener(this);
background.addItemListener(this);
checkpanel.add(foreground);
checkpanel.add(background);
workarea=new TextArea(8,40);
workarea.setFont(new Font("Garamond",Font.BOLD,20));
palettepanel=new Panel();
palettepanel.setLayout(new BorderLayout());
palettepanel.add(workarea,BorderLayout.CENTER);
palettepanel.add(checkpanel,BorderLayout.EAST);
palettepanel.add(buttonpanel,BorderLayout.SOUTH);
add(palettepanel);
}
public void itemStateChanged(ItemEvent ie)
{
}
public void actionPerformed(ActionEvent ae)
{
colour=ae.getActionCommand();
if(foreground.getState()==true)
workarea.setForeground(getColour());
if(background.getState()==true)
workarea.setBackground(getColour());
}
public Color getColour()
{
Color mycolor=null;
if(colour.equals("RED"))
mycolor=Color.red;
if(colour.equals("GREEN"))
mycolor=Color.green;
if(colour.equals("BLUE"))
mycolor=Color.blue;
if(colour.equals("CYAN"))
mycolor=Color.cyan;
if(colour.equals("ORANGE"))
mycolor=Color.orange;
if(colour.equals("WHITE"))
mycolor=Color.white;
if(colour.equals("BLACK"))
mycolor=Color.black;
if(colour.equals("YELLOW"))
mycolor=Color.yellow;
if(colour.equals("PINK"))
mycolor=Color.pink;
return mycolor;
}
}
getting the code
You really don't want to do that. Swing is for desktop applications. If you want to create a website, use Java Server Faces or Applets, not Swing.
this is to write or create
create a program that can input 100 names
Java allows the user to create whatever he desires, The user can add or remove security as they wish. Security can be added by the operating system in the the applet The applet can aquire security from the search engine, if a site has been targeted as a bad site then that site will not be able to run applets.
import java.applet.Applet; import java.awt.Graphics; @SuppressWarnings("serial") public class AppletTest extends Applet { public void paint (Graphics g) { g.drawString("WELCOME TO THE WORLD OF APPLETS", 100, 25); setBackground(java.awt.Color.RED); } } <HTML> <HEAD> <TITLE> AppletTest</TITLE> <BODY> <CENTER> <APPLET CODE = "AppletTest.class" WIDTH = 400 HEIGHT = 100 </APPLET> </CENTER> </BODY> </HEAD> <HTML>
Swing is used for desktop applications. Applets are used to create program which run in a browser.
Applets allow you to do frontend in java. You can draw things like rectangle,circle etc or create buttons and textboxes or you could even create a game! You can make use of the powerful api of java to design the applet and make use of awk(abstract window kit).
No, you just need to know how to type manually the code. Netbeans, instead, can type the code for your.
You really don't want to do that. Swing is for desktop applications. If you want to create a website, use Java Server Faces or Applets, not Swing.
I am wearing monochromatic today. I am wearing red, pink, and deep red. Add white and add a shade to create that monochromatic palette.
Go to poptropica then there will be two buttons with one of them saying "create" or something
Color Splash - 2007 A Light Palette and Rustic Elements Create a Seaside Feel in a Bedroom Makeover 5-6 was released on: USA: 7 February 2009
You can create a tool by dragging objects from your drawing onto a tool palette. You can then use the new tool to create objects with the same properties as the object you dragged onto the tool palette.Tool palettes are tabbed areas within the Tool Palettes window. The items you add to a tool palette are called tools. You can create a tool by dragging any of the following, one at a time, onto your tool palette:Geometric objects such as lines, circles, and polylinesDimensionsBlocksHatchesSolid fillsGradient fillsRaster imagesExternal references (xrefs)You can then use the new tool to create objects in your drawing with the same properties as the object you dragged to the tool palette. For example, if you drag a red circle with a lineweight of .05 mm from your drawing to your tool palette, the new tool creates a red circle with a lineweight of .05 mm. If you drag a block or xref to a tool palette, the new tool inserts the block or xref with the same properties into your drawing.When you drag a geometric object or a dimension onto a tool palette, the new tool is automatically created with an appropriate flyout. Dimension tool flyouts, for example, provide an assortment of dimension styles. Click the arrow on the right side of the tool icon on the tool palette to display the flyout. When you use a tool on a flyout, the object in the drawing has the same properties as the original tool on the tool palette.
word processing program
this is to write or create
create a program that can input 100 names
true