Tuesday, May 10, 2011

South Park Yaoi Couples

Graphic Interfaces (Workshop)

In this post I will present the codes to represent the sketches of the interface than previous designs for the project.

(those who make the lines solely responsible for the construction of the interface to no great length.)

first interface from the Start Menu or Control Panel Home.

This interface is the menu Welcome to the user, this will access the system options.

We begin by stating the method that will contain objects that were commissioned to create the interface to its components. Private void

 initComponents () {

jLabel1 = new javax.swing.JLabel ();
jLabel2 = new javax.swing.JLabel ();
jLabel3 = new javax.swing.JLabel ();
jLabel4 = new javax.swing.JLabel ();
jLabel5 = new javax.swing.JLabel ();
jTextField1 = new javax.swing.JTextField ();
jButton1 = new javax.swing.JButton ();

now declare each component of the interface to their attributes.
 jLabel1.setBackground (new java.awt.Color (0, 0, 0));  
jLabel1.setFont(new java.awt.Font("Arial", 1, 18));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("MENU PRINCIPAL");
jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("1 -> Agregar Producto");

jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText("2 -> View Product List ");

jLabel4.setFont (new java.awt.Font (" Tahoma ", 1, 14));
jLabel4.setHorizontalAlignment (javax.swing.SwingConstants.CENTER) jLabel4
. setText ("3 -> Exit the System");

jLabel5.setFont (new java.awt.Font ("Arial", 1, 14));
jLabel5.setHorizontalAlignment (javax.swing.SwingConstants.CENTER)
jLabel5.setText ("Enter option number:");

jTextField1.setHorizontalAlignment (javax.swing.JTextField.TRAILING)

jButton1.setFont (new java.awt.Font ("Tahoma", 1, 10) )
jButton1.setText ("ACCESS");

And finally, create the Panel and the Window of the interface, followed by accommodation that will have all the components before declared, to give beauty to the interface are declared sizes, positions and coordinates of each of these, one one.
 javax.swing.GroupLayout layout = new javax.swing.GroupLayout (getContentPane ()); 
getContentPane (). SetLayout (layout);
layout.setHorizontalGroup (
layout.createParallelGroup (javax.swing.GroupLayout.Alignment.LEADING )
. addgroup (layout.createSequentialGroup ()
. addGap (75, 75, 75)
. addComponent (jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE)
.addGap(163, 163, 163))
.addGroup(layout.createSequentialGroup()
.addGap(90, 90, 90)
.addComponent(jLabel5)
.addGap(38, 38, 38)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(224, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap(161, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4)))
.addGap(220, 220, 220))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
. addComponent (jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
. addComponent (jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax. swing.GroupLayout.PREFERRED_SIZE))
. addGap (41, 41, 41)
. addComponent (jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
. addGap (144, 144, 144 ))
)

pack ();}


Compilation Process / Enforcement:


Final Result:

Now for the panel interface Altas of Products.

Panel To High Product is practically the same as in the control panel only now are more JLabels and JTextFields.

This panel or interface is intended to fill a form in order to register a product in the system and save it. First the method

containing objects and attributes of the components of the GUI. Private void
 initComponents () {

jLabel1 = new javax.swing.JLabel ();
jLabel2 = new javax.swing.JLabel ();
jLabel3 = new javax.swing.JLabel ();
jLabel4 = new javax.swing.JLabel ();
jLabel5 = new javax.swing.JLabel ();
jTextField1 = new javax.swing.JTextField ();
jTextField2 = new javax.swing.JTextField ();
jTextField3 = new javax.swing.JTextField ();
jTextField4 = new javax.swing.JTextField ();
jButton1 = new javax.swing.JButton ();

jLabel1. setFont (new java.awt.Font ("Tahoma", 1, 18));
jLabel1.setHorizontalAlignment (javax.swing.SwingConstants.CENTER)
jLabel1.setText ("Product Data Entry);
jLabel1. setCursor (new java.awt.Cursor (java.awt.Cursor.CROSSHAIR_CURSOR));

jLabel2.setFont (new java.awt.Font ("Tahoma", 1, 14));
jLabel2.setText ("NAME");

jLabel3.setFont (new java.awt.Font ("Tahoma", 1, 14));
jLabel3.setText ("ID");

jLabel4.setFont (new java.awt.Font ("Tahoma", 1 , 14));
jLabel4.setText ("AVAILABLE AMOUNT");

jLabel5.setFont (new java.awt.Font ("Tahoma", 1, 14));
jLabel5.setText ("UNIT PRICE");

jButton1.setFont (new java.awt.Font ("Tahoma", 1, 14));
jButton1.setText ("ADD");

And then, the whole process of arranging and managing the interface components.

 javax.swing.GroupLayout layout = new javax.swing.GroupLayout (getContentPane ()); 
getContentPane (). SetLayout (layout);
layout.setHorizontalGroup (
layout.createParallelGroup (javax.swing.GroupLayout.Alignment. LEADING)
. addgroup (layout.createSequentialGroup ()
. addgroup (layout.createParallelGroup (javax.swing.GroupLayout.Alignment.LEADING)
. addgroup (layout.createSequentialGroup ()
. addGap (179, 179, 179)
. addComponent (jButton1))
.addGroup(layout.createSequentialGroup()
.addGap(70, 70, 70)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4)
.addComponent(jLabel5))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
.addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)))
.addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE)))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(35, 35, 35)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
. addGap (29, 29, 29)
. addgroup (layout.createParallelGroup (javax.swing.GroupLayout.Alignment.BASELINE)
. addComponent (jLabel5)
. addComponent (jTextField4, javax . swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
. addGap (30, 30, 30)
. addComponent (jButton1)
. addContainerGap (javax.swing.GroupLayout. DEFAULT_SIZE, Short.MAX_VALUE))
)

pack ();}

Compilation Process / Enforcement:



Final Result:

And finally, the interface for the option of inventory query or view. successfully Adding a product keeping the program going in a table that can then be accessed from the Main Control Panel.

method where we start the components of this interface: private void

 initComponents () {

jLabel1 = new javax.swing.JLabel ();
javax.swing.JScrollPane jScrollPane1 = new ();
jTable1 = new javax . swing.JTable ();

setDefaultCloseOperation (javax.swing.WindowConstants.EXIT_ON_CLOSE)

In this case the proof is only in a "static" (even I am in the process of connecting all the interfaces of the system)

header shall declare the interface .

 jLabel1.setFont (new java.awt.Font ("Tahoma", 1, 14)); 
jLabel1.setText ("STOCK LIST OF");

assign static parameters for the time we to test and demonstrate the interface. As an extra element to add a KeyListener that when we walk the table we highlight the item you have selected (either with arrows keyboard or by clicking on a particular cell with the mouse pointer).

 jTable1.setBorder (javax.swing.BorderFactory.createLineBorder (new java.awt.Color (0, 0, 0))); 
jTable1.setModel (new javax.swing.table.DefaultTableModel (
new Object [] []
{{"001", "Broom", "40", "19.90"},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}}
,
new String [] {
"ID", "NAME" "CANTIDAD", "PRECIO UNITARIO"
}
));
jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTable1KeyTyped(evt);
}
});
jScrollPane1.setViewportView(jTable1);

Y ya por ultimo mero ordenamiento de lo que fue el encabezado y el Panel que contiene esta interfaz.

 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 563, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(21, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(152, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(150, 150, 150))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
. Addgroup (layout.createSequentialGroup ()
. AddContainerGap ()
. AddComponent (jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
. AddGap (12, 12, 12)
. AddComponent (jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
. addContainerGap (56, Short.MAX_VALUE))
)

pack ();}


Compilation Process / Execution:


Bottom Line:

's it for this post, any questions comments or suggestions please comment, continue to add meat to this and will set out in the end exposures (:

Greetings!

0 comments:

Post a Comment