All source code in Java/ Javascript Ask a Java/ Javascript Pro Discussion Forum Categories All jobs in Java/ Javascript
Generates,random,tags,acronyms
   Code/Articles � |  Newest/Best � |  Community � |  Jobs � |  Other � |  Goto � | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Java/ Javascript Stats

 Code: 485,860. lines
 Jobs: 197. postings

 How to support the site

 
Sponsored by:
Quick Search for:  in language:    
You are in:
 
Login





Latest postings for Java/ Javascript.
Click here to see a screenshot of this code!automated glossary 2010 beta psychology 200 forced learning and memory restorer! rodlewis2010 beta!
By ROD LEWIS on 3/7

(Screen Shot)

Mouseover_3Imag e_Fader_Nav
By Mark Acuna on 3/7


Click here to see a screenshot of this code!NLabs' Folder Tree Generator
By nagesh borate on 2/28

(Screen Shot)

AI-TicTacToe
By Masood Fallahpoor on 3/4


Click here to see a screenshot of this code!Function
By Mr. SNMP Simamora on 3/4

(Screen Shot)

Click here to see a screenshot of this code!Median Number
By Mr. SNMP Simamora on 3/4

(Screen Shot)

Click here to see a screenshot of this code!Simple ppt viewer
By Rio Purwanggono on 3/3

(Screen Shot)

Click here to put this ticker on your site!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

Graffiti Tag Generator

Print
Email
 
VB icon
Submitted on: 11/14/2009 8:56:38 AM
By: LazyEye  
Level: Beginner
User Rating: Unrated
Compatibility:Java (JDK 1.5)

Users have accessed this code 1343 times.
 
author picture
(About the author)
 
     Generates random tags and acronyms.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

//**************************************
//     
// Name: Graffiti Tag Generator
// Description:Generates random tags and
//     acronyms.
// By: LazyEye
//
//This code is copyrighted and has// limited warranties.Please see http://
//     www.Planet-Source-Code.com/vb/scripts/Sh
//     owCode.asp?txtCodeId=6523&lngWId=2//for details.//**************************************
//     

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TagGenerator_v3 extends JFrame


    {	 
    JMenuItem menuitemSalir;
    JMenuItem menuitemInstrucciones;
    JMenuItem menuitemAcercade;
    JMenu menuArchivo;
    JMenu menuAyuda;
    JMenuBar barra;
    	
    JLabel selecciona;
    	
    JLabel etiquetaTags;
    JComboBox eleccionTags;
    JTextField campoTags;
    JButton generateTags; 
    JLabel ejemploTags;
    JLabel tagenpantalla;
    
    JLabel etiquetaSiglas;
    JComboBox eleccionSiglas;
    JTextField campoSiglas;
    JButton generarSiglas;
    JLabel ejemploSiglas;
    JLabel siglasenpantalla;
    
    String[] tagsCombinaciones = {"","CvC","CvCv","CvCvC","CvCvCv","CvCvCvC","vCv","vCvC","vCvCv","vCvCvC",
    				"vCvCvCv","CvvC","CvvCv","CvCCv","CvCCvC","CvCCvv","CvCCvvC","CvCCvCv",
    				"CvCvvCv","vCCv","vCCvv","vCCvC","vCvvC","vCvvCv","vCvCCv","vCvvCCv",
    				"vCvvCvC","vCvvCvv","vCvCCvC"}; //arreglo de 28 objetos String
    String[] tagsEjemplos = {"","SoR","SoSa","CoReL","TaBaCo","RoCaZeR","oMi","eRoZ","eMoSa","oRaLiX",
    			 "eXoGeCo","SeuS","ZeoRe","JiMBo","MoRTiZ","JaBLea","RoLTaeK","WeBXaVO",
    			 "DuNouDu","eKRo","aFLio","aRMeT","iSaiX","oBeiGo","eWarNu","aFioRSu",
    			 "oGauFiC","iVaeNoe","aSuRNoV"}; //arreglo de 28 objetos String
    String[] siglasCombinaciones ={"","CC","vv","Cv","vC","CCC","vvv","CCv","vvC","CvC","vCv","Cvv","vCC"};
    String[] siglasEjemplos = {"","FG","ai","Ko","aS","GKR","aaa","RPu","aeK","RiP","eTa","Cai","uPS",};
    	String[] consonantes = {"B","C","D","F","G","H","J","K",
    				"L","M","N","P","Q","R","S","T",
    				"V","W","X","Y","Z"}; //arreglo de 21 objetos String, son todas las consonantes
    String[] vocales = {"a","e","i","o","u"}; //arreglo de 5 objetos String
    String tag; //va a contener la cadena que se producira por cada generaci�n
    String siglas;
    int azarC; //va a contener un numero al azar del 0 al 20 al asignarsele el metedo Random de java.lang.Math
    int azarV; //los mismo que azarC pero tendra numeros del 0 al 4 
    public TagGenerator_v3()//constructor donde se construyen todos los componentes de la clase TagGenerator_v3


        { 
        Container contenedor = getContentPane();
        contenedor.setLayout( null );
        setTitle("TagGenerator v3.0");
        setResizable(false);
        menuitemSalir = new JMenuItem( "Salir" );
        menuitemSalir.setMnemonic('a');
        menuitemSalir.addActionListener( new ActionListener()


            					{
            						public void actionPerformed(ActionEvent e) 


                						{
                							System.exit( 0 );//m�todo que termina la ejecuaci�n del programa
                						}	
                					}
                				);
                menuitemInstrucciones = new JMenuItem( "Instrucciones" );
                menuitemInstrucciones.setMnemonic('n');
                menuitemInstrucciones.addActionListener( new ActionListener()


                    						{
                    							public void actionPerformed(ActionEvent e) 


                        							{
                        								JOptionPane.showMessageDialog( null, "1. Selecciona una combinaci�n de la lista desplegable." +
                        												"\n2. Oprime el bot�n que dice \"generar\".", "Instrucciones", JOptionPane.PLAIN_MESSAGE );
                        							}
                        						}
                        					);
                        menuitemAcercade = new JMenuItem( "Acerca de.." );
                        menuitemAcercade.setMnemonic('e');
                        menuitemAcercade.addActionListener( new ActionListener()


                            					{
                            						public void actionPerformed(ActionEvent e) 


                                						{
                                							JOptionPane.showMessageDialog( null, "Tag Generator v3.0 es una programa de dominio p�blico." +
                                											"\nDesarrollado por LazyEye.", "Acerca de Tag Generator v3.0", JOptionPane.PLAIN_MESSAGE );//m�todo que muestra una ventana de di�logo sin iconos
                                						}
                                					}
                                				 );
                                menuArchivo = new JMenu( "Archivo" );
                                menuArchivo.setMnemonic( 'r' );
                                menuArchivo.add( menuitemSalir );
                                menuAyuda = new JMenu( "Ayuda" );
                                menuAyuda.setMnemonic( 'y' );
                                menuAyuda.add( menuitemInstrucciones );
                                menuAyuda.add( menuitemAcercade );
                                barra = new JMenuBar();
                                setJMenuBar( barra );
                                barra.add( menuArchivo );
                                barra.add( menuAyuda );
                                selecciona = new JLabel();
                                selecciona.setFont( new Font("Tahoma", 1 , 10) );
                                selecciona.setText( "Selecciona una combinaci�n: " );
                                selecciona.setBounds(10, 0, 200, 40);
                                contenedor.add( selecciona );
                                
                                etiquetaTags = new JLabel();
                                etiquetaTags.setText( "TAG" );
                                etiquetaTags.setBounds(20, 30, 30, 20);
                                contenedor.add( etiquetaTags );
                                eleccionTags = new JComboBox( tagsCombinaciones );
                                eleccionTags.setMaximumRowCount(4);
                                eleccionTags.setBounds(65, 30, 90, 23);
                                eleccionTags.addActionListener( new ActionListener()


                                    					{
                                    						public void actionPerformed( ActionEvent evento )


                                        						{
                                        							ejemploTags.setText( "ej. " + tagsEjemplos[ eleccionTags.getSelectedIndex() ]);
                                        							//m�todo que despliega texto en JLabel ejemplo, se le da como argumento la
                                        							//cadena "ej. " m�s la cadena que sale del valor de ejemplos con
                                        							//�ndice igual al �ndice de la combinaci�n elegida en JComboBox eleccion 														
                                        						}
                                        					}
                                        				);
                                        contenedor.add( eleccionTags );
                                        campoTags = new JTextField();
                                        campoTags.setBounds(165, 30, 90, 23);
                                        contenedor.add( campoTags );
                                        generateTags = new JButton();
                                        generateTags.setText( "generar" );
                                        generateTags.setBounds(265, 30, 90, 23);
                                        generateTags.addActionListener( new ActionListener()


                                            					{
                                            						public void actionPerformed( ActionEvent evento ) 


                                                						{
                                                							generarActionPerformed( evento );//m�todo que genera los tags al azar
                                                						}
                                                					}
                                                				 );
                                                contenedor.add( generateTags );
                                                ejemploTags = new JLabel();
                                                ejemploTags.setFont( new Font( "Tahoma", 1 , 10) );
                                                ejemploTags.setText( "ej." );
                                                ejemploTags.setBounds(60, 55, 200, 20);
                                                contenedor.add( ejemploTags );
                                                tagenpantalla = new JLabel();
                                                tagenpantalla.setFont( new Font("Tahoma", 1, 25) );
                                                tagenpantalla.setForeground( new java.awt.Color(0, 0, 0) );
                                                tagenpantalla.setText("");
                                                tagenpantalla.setBounds(150, 60, 220, 50); //posici�n y tama�o de la etiqueta
                                                contenedor.add( tagenpantalla );
                                                etiquetaSiglas = new JLabel();
                                                etiquetaSiglas.setText( "CREW" );
                                                etiquetaSiglas.setBounds(20, 130, 50, 20);
                                                contenedor.add( etiquetaSiglas );
                                                eleccionSiglas = new JComboBox( siglasCombinaciones );
                                                eleccionSiglas.setMaximumRowCount(4);
                                                eleccionSiglas.setBounds(65, 130, 90, 23);
                                                eleccionSiglas.addActionListener( new ActionListener()


                                                    					{
                                                    						public void actionPerformed( ActionEvent evento )


                                                        						{
                                                        							ejemploSiglas.setText( "ej. " + siglasEjemplos[ eleccionSiglas.getSelectedIndex() ]);
                                                        							//m�todo que despliega texto en JLabel ejemplo, se le da como argumento la
                                                        							//cadena "ej. " m�s la cadena que sale del valor de ejemplos con
                                                        							//�ndice igual al �ndice de la combinaci�n elegida en JComboBox eleccion 														
                                                        						}
                                                        					}
                                                        				 );
                                                        contenedor.add( eleccionSiglas );
                                                        campoSiglas = new JTextField();
                                                        campoSiglas.setBounds(165, 130, 90, 23);
                                                        contenedor.add( campoSiglas );
                                                        generarSiglas = new JButton();
                                                        generarSiglas.setText( "generar" );
                                                        generarSiglas.setBounds(265, 130, 90, 23);
                                                        generarSiglas.addActionListener( new ActionListener()


                                                            					{
                                                            						public void actionPerformed( ActionEvent evento ) 


                                                                						{
                                                                							generarsiglasActionPerformed( evento );//m�todo que genera los tags al azar
                                                                						}
                                                                					}
                                                                				);
                                                                contenedor.add( generarSiglas );
                                                                ejemploSiglas = new JLabel();
                                                                ejemploSiglas.setFont( new Font( "Tahoma", 1 , 10) );
                                                                ejemploSiglas.setText( "ej." );
                                                                ejemploSiglas.setBounds(60, 155, 200, 20);
                                                                contenedor.add( ejemploSiglas );
                                                                siglasenpantalla = new JLabel();
                                                                siglasenpantalla.setFont( new Font("Tahoma", 1, 25) );
                                                                siglasenpantalla.setForeground( new java.awt.Color(0, 0, 0) );
                                                                siglasenpantalla.setText("");
                                                                siglasenpantalla.setBounds(150, 160, 220, 50);
                                                                contenedor.add( siglasenpantalla );
                                                                Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); //obtines las dimensiones de nuestra resoluci�n de pantalla
                                                                setBounds( (screenSize.width-350)/2, (screenSize.height-171)/2, 420, 300); //posici�n y tama�o del JFrame( x, y, ancho, largo)
                                                                setVisible( true );
                                                            }//fin del constructor de la clase TagGenerator_v3

private void generarActionPerformed( ActionEvent evento )//evento que se dispara cuando se da clic en generar { try { switch( eleccionTags.getSelectedIndex() ) { case 0: tag = "<-----"; actualizar(); break; case 1: tag = mCvC( tag ); actualizar(); break; case 2: tag = mCvC( tag ); tag += mv( tag ); actualizar(); break; case 3: tag = mCvC( tag ); tag += mvC( tag ); actualizar(); break; case 4: tag = mCvC( tag ); tag += mvCv( tag ); actualizar(); break; case 5: tag = mCvC( tag ); tag += mvCv( tag ); tag += mC( tag ); actualizar(); break; case 6: tag = mvCv( tag ); actualizar(); break; case 7: tag = mvCv( tag ); tag += mC( tag ); actualizar(); break; case 8: tag = mvCv( tag ); tag += mCv( tag ); actualizar(); break; case 9: tag = mvCv( tag ); tag += mCvC( tag ); actualizar(); break; case 10: tag = mvCv( tag ); tag += mCvC( tag ); tag += mv( tag ); actualizar(); break; case 11: tag = mCvv( tag ); tag += mC( tag ); actualizar(); break; case 12: tag = mCvv( tag ); tag += mCv( tag ); actualizar(); break; case 13: tag = mCvC( tag ); tag += mCv( tag ); actualizar(); break; case 14: tag = mCvC( tag ); tag += mCvC( tag ); actualizar(); break; case 15: tag = mCvC( tag ); tag += mCvv( tag ); actualizar(); break; case 16: tag = mCvC( tag ); tag += mCvv( tag ); tag += mC( tag ); actualizar(); break; case 17: tag = mCvC( tag ); tag += mCvC( tag ); tag += mv( tag ); actualizar(); break; case 18: tag = mCvC( tag ); tag += mvvC( tag ); tag += mv( tag ); actualizar(); break; case 19: tag = mvCC( tag ); tag += mv( tag ); actualizar(); break; case 20: tag = mvCC( tag ); tag += mvv( tag ); actualizar(); break; case 21: tag = mvCC( tag ); tag += mvC( tag ); actualizar(); break; case 22: tag = mvCv( tag ); tag += mvC( tag ); actualizar(); break; case 23: tag = mvCv( tag ); tag += mvCv( tag ); actualizar(); break; case 24: tag = mvCv( tag ); tag += mCCv( tag ); actualizar(); break; case 25: tag = mvCv( tag ); tag += mvCC( tag ); tag += mv( tag ); actualizar(); break; case 26: tag = mvCv( tag ); tag += mvCv( tag ); tag += mC( tag ); actualizar(); break; case 27: tag = mvCv( tag ); tag += mvCv( tag ); tag += mv( tag ); actualizar(); break; case 28: tag = mvCv( tag ); tag += mCCv( tag ); tag += mC( tag ); actualizar(); break; default: break; } }//fin del try
catch (Exception e) { }
}// fin del m�todo generarActionPerformed
public void generarsiglasActionPerformed( ActionEvent evento ) { try { switch( eleccionSiglas.getSelectedIndex() ) { case 0: siglas = "<-----"; actualizarSiglas(); break; case 1: siglas = mCC( siglas ); actualizarSiglas(); break; case 2: siglas = mvv( siglas ); actualizarSiglas(); break; case 3: siglas = mCv( siglas ); actualizarSiglas(); break; case 4: siglas = mvC( siglas ); actualizarSiglas(); break; case 5: siglas = mCCC( siglas ); actualizarSiglas(); break; case 6: siglas = mvvv( siglas ); actualizarSiglas(); break; case 7: siglas = mCCv( siglas ); actualizarSiglas(); break; case 8: siglas = mvvC( siglas ); actualizarSiglas(); break; case 9: siglas = mCvC( siglas ); actualizarSiglas(); break; case 10: siglas = mvCv( siglas ); actualizarSiglas(); break; case 11: siglas = mCvv( siglas ); actualizarSiglas(); break; case 12: siglas = mvCC( siglas ); actualizarSiglas(); break; default: break; } } catch (Exception e) { } }
public String mC( String tag ) { azarC = ( int )( Math.random() * consonantes.length ); tag = consonantes[ azarC ]; return tag; }
public String mv( String tag ) { azarV = ( int )( Math.random() * vocales.length ); tag = vocales[ azarV ]; return tag; }
public String mCC( String tag ) { tag = mC( tag ); tag += mC( tag ); return tag; }
public String mCv( String tag ) { tag = mC( tag ); tag += mv( tag ); return tag; }
public String mvv( String tag ) { tag = mv( tag ); tag += mv( tag ); return tag; }
public String mvC( String tag ) { tag = mv( tag ); tag += mC( tag ); return tag; }
public String mCvC( String tag ) { tag = mC( tag ); tag += mv( tag ); tag += mC( tag ); return tag; }
public String mvCv( String tag ) { tag = mv( tag ); tag += mC( tag ); tag += mv( tag ); return tag; }
public String mvvv( String tag ) { tag = mv( tag ); tag += mv( tag ); tag += mv( tag ); return tag; }
public String mCCC( String tag ) { tag = mC( tag ); tag += mC( tag ); tag += mC( tag ); return tag; }
public String mCCv( String tag ) { tag = mC( tag ); tag += mC( tag ); tag += mv( tag ); return tag; }
public String mvCC( String tag ) { tag = mv( tag ); tag += mC( tag ); tag += mC( tag ); return tag; }
public String mvvC( String tag ) { tag = mv( tag ); tag += mv( tag ); tag += mC( tag ); return tag; }
public String mCvv( String tag ) { tag = mC( tag ); tag += mv( tag ); tag += mv( tag ); return tag; }
public void actualizar() //este m�todo hace que aparezca el tag en campo y en tagenpantalla, y vuelve a darle una cadena vacia a tag { campoTags.setText( tag ); tagenpantalla.setText( "\"" + tag.toUpperCase() + " ONE\""); tag = ""; }
public void actualizarSiglas(){ campoSiglas.setText( siglas ); siglasenpantalla.setText( "" + siglas.toUpperCase() + "�"); siglas = ""; }
public static void main( String[] args )// m�todo que inicia la creaci�n de la clase TagGenerator { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//detecta la apariencia de tu OS } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } TagGenerator_v3 aplicacion = new TagGenerator_v3(); aplicacion.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); }// fin de m�todo main
}// fin de la clase TagGenerator_v3

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Games | Feedback | Customize | Java/ Javascript Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright� 1997-2010 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Exhedra solutions has no affiliation with Sun Microsystems, Inc.. Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.