You are on page 1of 12

/*ByRosA Estaaplicacinestmanejandounabasededatosdeblogs;eneldiseoquedecidutilizar, aparecencuatrotablas:users,blogs,commentsyentries. Enlamedidadeloposiblecomentarpartesdelcdigogenerado,explicandoloquehace. Paraquenohayapierdehedecididocolocarloscomentariosenbold. Fechadeentrega:24denoviembre2008 RosaAuroraRodrguezEspinosa */ packageblogsdataaplication; //Esteeselnombredemiproyecto importorg.jdesktop.application.Action; importorg.jdesktop.application.ResourceMap; importorg.jdesktop.application.SingleFrameApplication; importorg.jdesktop.application.FrameView; importorg.jdesktop.application.TaskMonitor; importorg.jdesktop.application.

Task; importjava.awt.event.ActionEvent; importjava.awt.event.ActionListener; importjava.util.ArrayList; importjava.util.List; importjavax.persistence.RollbackException; importjavax.swing.Timer; importjavax.swing.Icon; importjavax.swing.JDialog; importjavax.swing.JFrame; importjavax.swing.event.ListSelectionEvent; importjavax.swing.event.ListSelectionListener; importorg.jdesktop.beansbinding.AbstractBindingListener; importorg.jdesktop.beansbinding.Binding; importorg.jdesktop.beansbinding.PropertyStateEvent;

//Todaestaparteesparacrearlainterfaz: publicclassBlogsDataAplicationViewextendsFrameView{ publicBlogsDataAplicationView(SingleFrameApplicationapp){ super(app); initComponents(); //statusbarinitialization messagetimeout,idleiconandbusyanimation,etc ResourceMapresourceMap=getResourceMap(); intmessageTimeout=resourceMap.getInteger("StatusBar.messageTimeout"); messageTimer=newTimer(messageTimeout,newActionListener(){ publicvoidactionPerformed(ActionEvente){ statusMessageLabel.setText(""); } }); messageTimer.setRepeats(false); intbusyAnimationRate=resourceMap.getInteger("StatusBar.busyAnimationRate"); for(inti=0;i<busyIcons.length;i++){

busyIcons[i]=resourceMap.getIcon("StatusBar.busyIcons["+i+"]"); } busyIconTimer=newTimer(busyAnimationRate,newActionListener(){ publicvoidactionPerformed(ActionEvente){ busyIconIndex=(busyIconIndex+1)%busyIcons.length; statusAnimationLabel.setIcon(busyIcons[busyIconIndex]); } }); idleIcon=resourceMap.getIcon("StatusBar.idleIcon"); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false); //connectingactiontaskstostatusbarviaTaskMonitor TaskMonitortaskMonitor=newTaskMonitor(getApplication().getContext()); taskMonitor.addPropertyChangeListener(newjava.beans.PropertyChangeListener(){ publicvoidpropertyChange(java.beans.PropertyChangeEventevt){ StringpropertyName=evt.getPropertyName(); if("started".equals(propertyName)){ if(!busyIconTimer.isRunning()){ statusAnimationLabel.setIcon(busyIcons[0]); busyIconIndex=0; busyIconTimer.start(); } progressBar.setVisible(true); progressBar.setIndeterminate(true); }elseif("done".equals(propertyName)){ busyIconTimer.stop(); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false); progressBar.setValue(0); }elseif("message".equals(propertyName)){ Stringtext=(String)(evt.getNewValue()); statusMessageLabel.setText((text==null)?"":text); messageTimer.restart(); }elseif("progress".equals(propertyName)){ intvalue=(Integer)(evt.getNewValue()); progressBar.setVisible(true); progressBar.setIndeterminate(false); progressBar.setValue(value); } } }); //trackingtableselection masterTable.getSelectionModel().addListSelectionListener( newListSelectionListener(){ publicvoidvalueChanged(ListSelectionEvente){ firePropertyChange("recordSelected",!isRecordSelected(),isRecordSelected()); } }); //trackingchangestosave

bindingGroup.addBindingListener(newAbstractBindingListener(){ @Override publicvoidtargetChanged(Bindingbinding,PropertyStateEventevent){ //saveactionobservessaveNeededproperty setSaveNeeded(true); } }); //haveatransactionstarted entityManager.getTransaction().begin(); }

publicbooleanisSaveNeeded(){ returnsaveNeeded; } privatevoidsetSaveNeeded(booleansaveNeeded){ if(saveNeeded!= this.saveNeeded){ this.saveNeeded=saveNeeded; firePropertyChange("saveNeeded",!saveNeeded,saveNeeded); } } publicbooleanisRecordSelected(){ returnmasterTable.getSelectedRow()!= 1; }

@Action /*EstapartecorrespondealbotnNEW queseencuentradefinidaenlainterfaz; Comosepuedenotar,annosehanagregadoloquesoneventosparaestebotn,asque aunqueloscampospuedanrecibirdatos,annoestamosmodificandolabasede datos*/ publicvoidnewRecord(){ blogsdataaplication.Blogsb=newblogsdataaplication.Blogs(); entityManager.persist(b); list.add(b); introw=list.size()1; masterTable.setRowSelectionInterval(row,row); masterTable.scrollRectToVisible(masterTable.getCellRect(row,0,true)); setSaveNeeded(true); } @Action(enabledProperty="recordSelected") publicvoiddeleteRecord(){ int[]selected=masterTable.getSelectedRows(); List<blogsdataaplication.Blogs>toRemove=new ArrayList<blogsdataaplication.Blogs>(selected.length); for(intidx=0;idx<selected.length;idx++){ blogsdataaplication.Blogsb= list.get(masterTable.convertRowIndexToModel(selected[idx]));

toRemove.add(b); entityManager.remove(b); } list.removeAll(toRemove); setSaveNeeded(true); } /*EstaparteesparaelbotndeSAVED @Action(enabledProperty="saveNeeded") publicTask save(){ returnnewSaveTask(getApplication()); } privateclassSaveTaskextendsTask{ SaveTask(org.jdesktop.application.Applicationapp){ super(app); } @OverrideprotectedVoiddoInBackground(){ try{ entityManager.getTransaction().commit(); entityManager.getTransaction().begin(); }catch(RollbackExceptionrex){ rex.printStackTrace(); entityManager.getTransaction().begin(); List<blogsdataaplication.Blogs>merged=new ArrayList<blogsdataaplication.Blogs>(list.size()); /*LaraznporlaqueutilizamosunArrayListesporquenotenemosennmeroexactode blogsqueseagregarnfinalmenteycomoestetipodeobjetosnotienenunlmitede elementos,nossondegranutilidadparaestetipodecasos*/ for(blogsdataaplication.Blogsb:list){ merged.add(entityManager.merge(b)); } list.clear(); list.addAll(merged); } returnnull; } @Overrideprotectedvoidfinished(){ setSaveNeeded(false); } } /** *Anexampleactionmethodshowinghowtocreate asynchronoustasks *(runningonbackground)andhowtoshowtheirprogress.Notethe *artificial'Thread.sleep'callsmakingthetasklongenoughtoseethe *progressvisualization removethesleepsforrealapplication. */ @Action publicTaskrefresh(){ returnnewRefreshTask(getApplication()); }

privateclassRefreshTaskextendsTask{ RefreshTask(org.jdesktop.application.Applicationapp){ super(app); } @SuppressWarnings("unchecked") @OverrideprotectedVoiddoInBackground(){ try{ setProgress(0,0,4); setMessage("Rollingbackthecurrentchanges..."); setProgress(1,0,4); entityManager.getTransaction().rollback(); Thread.sleep(1000L);//removeforrealapp setProgress(2,0,4); setMessage("Startinganewtransaction..."); entityManager.getTransaction().begin(); Thread.sleep(500L);//removeforrealapp setProgress(3,0,4); setMessage("Fetchingnewdata..."); java.util.Collectiondata=query.getResultList(); for(Objectentity:data){ entityManager.refresh(entity); } Thread.sleep(1300L);//removeforrealapp setProgress(4,0,4); Thread.sleep(150L);//removeforrealapp list.clear(); list.addAll(data); }catch(InterruptedExceptionignore){} returnnull; } @Overrideprotectedvoidfinished(){ setMessage("Done."); setSaveNeeded(false); } } @Action publicvoidshowAboutBox(){ if(aboutBox==null){ JFramemainFrame=BlogsDataAplicationApp.getApplication().getMainFrame(); aboutBox=newBlogsDataAplicationAboutBox(mainFrame); aboutBox.setLocationRelativeTo(mainFrame); } BlogsDataAplicationApp.getApplication().show(aboutBox); } /**Thismethodiscalledfromwithintheconstructorto *initializetheform.

*WARNING:DoNOTmodifythiscode.Thecontentofthis methodis *alwaysregeneratedbytheFormEditor. */ @SuppressWarnings("unchecked") //<editorfolddefaultstate="collapsed"desc="GeneratedCode"> privatevoidinitComponents(){ bindingGroup=neworg.jdesktop.beansbinding.BindingGroup(); mainPanel=newjavax.swing.JPanel(); masterScrollPane=newjavax.swing.JScrollPane(); masterTable=newjavax.swing.JTable(); blogIdLabel=newjavax.swing.JLabel(); blogTitleLabel=newjavax.swing.JLabel(); blogDateLabel=newjavax.swing.JLabel(); blogIdField=newjavax.swing.JTextField(); blogTitleField=newjavax.swing.JTextField(); blogDateField=newjavax.swing.JTextField(); saveButton=newjavax.swing.JButton(); refreshButton=newjavax.swing.JButton(); newButton=newjavax.swing.JButton(); deleteButton=newjavax.swing.JButton(); menuBar=newjavax.swing.JMenuBar(); javax.swing.JMenufileMenu=newjavax.swing.JMenu(); javax.swing.JMenuItemnewRecordMenuItem=newjavax.swing.JMenuItem(); javax.swing.JMenuItemdeleteRecordMenuItem=newjavax.swing.JMenuItem(); jSeparator1=newjavax.swing.JSeparator(); javax.swing.JMenuItemsaveMenuItem=newjavax.swing.JMenuItem(); javax.swing.JMenuItemrefreshMenuItem=newjavax.swing.JMenuItem(); jSeparator2=newjavax.swing.JSeparator(); javax.swing.JMenuItemexitMenuItem=newjavax.swing.JMenuItem(); javax.swing.JMenuhelpMenu=newjavax.swing.JMenu(); javax.swing.JMenuItemaboutMenuItem=newjavax.swing.JMenuItem(); statusPanel=newjavax.swing.JPanel(); javax.swing.JSeparatorstatusPanelSeparator=newjavax.swing.JSeparator(); statusMessageLabel=newjavax.swing.JLabel(); statusAnimationLabel=newjavax.swing.JLabel(); progressBar=newjavax.swing.JProgressBar(); entityManager=java.beans.Beans.isDesignTime()?null: javax.persistence.Persistence.createEntityManagerFactory("universidadPU").createEntityMana ger(); org.jdesktop.application.ResourceMapresourceMap= org.jdesktop.application.Application.getInstance(blogsdataaplication.BlogsDataAplicationApp. class).getContext().getResourceMap(BlogsDataAplicationView.class); query=java.beans.Beans.isDesignTime()?null: entityManager.createQuery(resourceMap.getString("query.query"));//NOI18N list=java.beans.Beans.isDesignTime()?java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList(query.getResultList()) ; mainPanel.setName("mainPanel");//NOI18N masterScrollPane.setName("masterScrollPane");//NOI18N

masterTable.setName("masterTable");//NOI18N org.jdesktop.swingbinding.JTableBindingjTableBinding= org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.Auto Binding.UpdateStrategy.READ_WRITE,list,masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBindingcolumnBinding= jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${blogId}")); columnBinding.setColumnName("BlogId"); columnBinding.setColumnClass(Short.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${blogTitle}")) ; columnBinding.setColumnName("BlogTitle"); columnBinding.setColumnClass(String.class); columnBinding= jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${blogDate}")) ; columnBinding.setColumnName("BlogDate"); columnBinding.setColumnClass(java.util.Date.class); bindingGroup.addBinding(jTableBinding); masterScrollPane.setViewportView(masterTable); blogIdLabel.setText(resourceMap.getString("blogIdLabel.text"));//NOI18N blogIdLabel.setName("blogIdLabel");//NOI18N blogTitleLabel.setText(resourceMap.getString("blogTitleLabel.text"));//NOI18N blogTitleLabel.setName("blogTitleLabel");//NOI18N blogDateLabel.setText(resourceMap.getString("blogDateLabel.text"));//NOI18N blogDateLabel.setName("blogDateLabel");//NOI18N blogIdField.setName("blogIdField");//NOI18N org.jdesktop.beansbinding.Bindingbinding= org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBindin g.UpdateStrategy.READ_WRITE,masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.blogId}"),blogIdField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding= org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBindin g.UpdateStrategy.READ,masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement!=null}"),blogIdField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); blogTitleField.setName("blogTitleField");//NOI18N

binding= org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBindin g.UpdateStrategy.READ_WRITE,masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.blogTitle}"),blogTitleField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding= org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBindin g.UpdateStrategy.READ,masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement!=null}"),blogTitleField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); blogDateField.setName("blogDateField");//NOI18N binding= org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBindin g.UpdateStrategy.READ_WRITE,masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.blogDate}"),blogDateField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding= org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBindin g.UpdateStrategy.READ,masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement!=null}"),blogDateField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); javax.swing.ActionMapactionMap= org.jdesktop.application.Application.getInstance(blogsdataaplication.BlogsDataAplicationApp. class).getContext().getActionMap(BlogsDataAplicationView.class,this); saveButton.setAction(actionMap.get("save"));//NOI18N saveButton.setName("saveButton");//NOI18N refreshButton.setAction(actionMap.get("refresh"));//NOI18N refreshButton.setName("refreshButton");//NOI18N newButton.setAction(actionMap.get("newRecord"));//NOI18N newButton.setName("newButton");//NOI18N deleteButton.setAction(actionMap.get("deleteRecord"));//NOI18N deleteButton.setName("deleteButton");//NOI18N javax.swing.GroupLayoutmainPanelLayout=newjavax.swing.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout.setHorizontalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup() .addComponent(newButton)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(saveButton) .addContainerGap()) .addGroup(mainPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN G) .addComponent(blogIdLabel) .addComponent(blogTitleLabel) .addComponent(blogDateLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN G) .addComponent(blogIdField,javax.swing.GroupLayout.DEFAULT_SIZE,315, Short.MAX_VALUE) .addComponent(blogTitleField,javax.swing.GroupLayout.DEFAULT_SIZE,315, Short.MAX_VALUE) .addComponent(blogDateField,javax.swing.GroupLayout.DEFAULT_SIZE,315, Short.MAX_VALUE)) .addContainerGap()) .addGroup(mainPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(masterScrollPane,javax.swing.GroupLayout.DEFAULT_SIZE,380, Short.MAX_VALUE) .addContainerGap()) ); mainPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL,new java.awt.Component[]{deleteButton,newButton, refreshButton,saveButton}); mainPanelLayout.setVerticalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(masterScrollPane,javax.swing.GroupLayout.DEFAULT_SIZE,130, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI NE) .addComponent(blogIdLabel) .addComponent(blogIdField,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI NE) .addComponent(blogTitleLabel) .addComponent(blogTitleField,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI NE) .addComponent(blogDateLabel) .addComponent(blogDateField,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI NE) .addComponent(saveButton) .addComponent(refreshButton) .addComponent(deleteButton) .addComponent(newButton)) .addContainerGap()) ); menuBar.setName("menuBar");//NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text"));//NOI18N fileMenu.setName("fileMenu");//NOI18N newRecordMenuItem.setAction(actionMap.get("newRecord"));//NOI18N newRecordMenuItem.setName("newRecordMenuItem");//NOI18N fileMenu.add(newRecordMenuItem); deleteRecordMenuItem.setAction(actionMap.get("deleteRecord"));//NOI18N deleteRecordMenuItem.setName("deleteRecordMenuItem");//NOI18N fileMenu.add(deleteRecordMenuItem); jSeparator1.setName("jSeparator1");//NOI18N fileMenu.add(jSeparator1); saveMenuItem.setAction(actionMap.get("save"));//NOI18N saveMenuItem.setName("saveMenuItem");//NOI18N fileMenu.add(saveMenuItem); refreshMenuItem.setAction(actionMap.get("refresh"));//NOI18N refreshMenuItem.setName("refreshMenuItem");//NOI18N fileMenu.add(refreshMenuItem); jSeparator2.setName("jSeparator2");//NOI18N fileMenu.add(jSeparator2); exitMenuItem.setAction(actionMap.get("quit"));//NOI18N

exitMenuItem.setName("exitMenuItem");//NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); helpMenu.setText(resourceMap.getString("helpMenu.text"));//NOI18N helpMenu.setName("helpMenu");//NOI18N aboutMenuItem.setAction(actionMap.get("showAboutBox"));//NOI18N aboutMenuItem.setName("aboutMenuItem");//NOI18N helpMenu.add(aboutMenuItem); menuBar.add(helpMenu); statusPanel.setName("statusPanel");//NOI18N statusPanelSeparator.setName("statusPanelSeparator");//NOI18N statusMessageLabel.setName("statusMessageLabel");//NOI18N statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); statusAnimationLabel.setName("statusAnimationLabel");//NOI18N progressBar.setName("progressBar");//NOI18N javax.swing.GroupLayoutstatusPanelLayout=newjavax.swing.GroupLayout(statusPanel); statusPanel.setLayout(statusPanelLayout); statusPanelLayout.setHorizontalGroup( statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(statusPanelSeparator,javax.swing.GroupLayout.DEFAULT_SIZE,400, Short.MAX_VALUE) .addGroup(statusPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(statusMessageLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,226, Short.MAX_VALUE) .addComponent(progressBar,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(statusAnimationLabel) .addContainerGap()) ); statusPanelLayout.setVerticalGroup( statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(statusPanelLayout.createSequentialGroup() .addComponent(statusPanelSeparator,javax.swing.GroupLayout.PREFERRED_SIZE,2, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE) .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI NE)

.addComponent(statusMessageLabel) .addComponent(statusAnimationLabel) .addComponent(progressBar,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(3, 3,3)) ); setComponent(mainPanel); setMenuBar(menuBar); setStatusBar(statusPanel); bindingGroup.bind(); }//</editorfold> //Variablesdeclaration donotmodify privatejavax.swing.JTextFieldblogDateField; privatejavax.swing.JLabelblogDateLabel; privatejavax.swing.JTextFieldblogIdField; privatejavax.swing.JLabelblogIdLabel; privatejavax.swing.JTextFieldblogTitleField; privatejavax.swing.JLabelblogTitleLabel; privatejavax.swing.JButtondeleteButton; privatejavax.persistence.EntityManagerentityManager; privatejavax.swing.JSeparatorjSeparator1; privatejavax.swing.JSeparatorjSeparator2; privatejava.util.List<blogsdataaplication.Blogs>list; privatejavax.swing.JPanelmainPanel; privatejavax.swing.JScrollPanemasterScrollPane; privatejavax.swing.JTablemasterTable; privatejavax.swing.JMenuBarmenuBar; privatejavax.swing.JButtonnewButton; privatejavax.swing.JProgressBar progressBar; privatejavax.persistence.Queryquery; privatejavax.swing.JButtonrefreshButton; privatejavax.swing.JButtonsaveButton; privatejavax.swing.JLabelstatusAnimationLabel; privatejavax.swing.JLabelstatusMessageLabel; privatejavax.swing.JPanelstatusPanel; privateorg.jdesktop.beansbinding.BindingGroupbindingGroup; //Endofvariablesdeclaration privatefinalTimermessageTimer; privatefinalTimerbusyIconTimer; privatefinalIconidleIcon; privatefinalIcon[]busyIcons=newIcon[15]; privateintbusyIconIndex=0; privateJDialogaboutBox; privatebooleansaveNeeded; }