analistadeperon Goto Github PK
Name: *******************************
Type: User
Company: https://github.com/
Name: *******************************
Type: User
Company: https://github.com/
Sistema de Cadastro de Cliente com Java
Criando APIs com ASP.NET 6
The AdoteUmDev project
Website fins de estudo.
setDefaultCloseOperation serialVersionUID java //* package agenda.gui;java import java.awt.BorderLayout; public class AgendaFrame extends JFrame { private static final long serialVersionUID = 1L; private JPanel contentPane; public AgendaFrame() { setTitle("Agenda"); setResizable(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); setContentPane(contentPane); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); ListaEventosPanel listaEventosPanel = new ListaEventosPanel(); tabbedPane.addTab("Cadastro de Eventos", new CadastroEventoPanel(listaEventosPanel)); tabbedPane.addTab("Lista de Eventos", listaEventosPanel); contentPane.add(tabbedPane, BorderLayout.CENTER); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } package agenda.vo; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; import agenda.utils.PeriodicidadeEnum; public class Evento implements Serializable { private static final long serialVersionUID = 1L; private Date dataEvento; private String descEvento; private PeriodicidadeEnum periodicidade; private String emailEncaminhar; private int alarme; public Evento() { super(); } public Evento(Date dataEvento, String descEvento, PeriodicidadeEnum periodicidade, String emailEncaminhar, int alarme) { super(); this.dataEvento = dataEvento; this.descEvento = descEvento; this.periodicidade = periodicidade; this.emailEncaminhar = emailEncaminhar; this.alarme = alarme; } public Date getDataEvento() { return dataEvento; } public void setDataEvento(Date dataEvento) { this.dataEvento = dataEvento; } public String getDescEvento() { return descEvento; } public void setDescEvento(String descEvento) { this.descEvento = descEvento; } public PeriodicidadeEnum getPeriodicidade() { return periodicidade; } public void setPeriodicidade(PeriodicidadeEnum periodicidade) { this.periodicidade = periodicidade; } public String getEmailEncaminhar() { return emailEncaminhar; } public void setEmailEncaminhar(String emailEncaminhar) { this.emailEncaminhar = emailEncaminhar; } public int getAlarme() { return alarme; } public void setAlarme(int alarme) { this.alarme = alarme; } public String toString(){ SimpleDateFormat mascaraData = new SimpleDateFormat("dd/MM/yyyy"); return (mascaraData.format(getDataEvento()) + ";" + getDescEvento() + ";" + getPeriodicidade() + ";" + getEmailEncaminhar() + ";" + getAlarme()); } } package agenda.utils; public enum PeriodicidadeEnum { UNICO, SEMANAL, MENSAL; } package agenda.utils; import java.util.Calendar; import java.util.Date; public class AgendaUtils { public static Date getDateFromString(String dataStr){ Calendar data = Calendar.getInstance(); data.set(Calendar.YEAR, Integer.parseInt(dataStr.substring(6, 10))); data.set(Calendar.MONTH, Integer.parseInt(dataStr.substring(3, 5))); data.set(Calendar.DAY_OF_MONTH, Integer.parseInt(dataStr.substring(0, 2))); return data.getTime(); } } package agenda.io; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.util.Vector; import agenda.utils.PeriodicidadeEnum; import agenda.vo.Evento; public class AgendaIO { private final String DIRETORIO = "."; private final String ARQUIVO = "eventos.txt"; public void gravarEvento(Evento evento)throws Exception{ try { BufferedWriter writer = new BufferedWriter(new FileWriter (new File(DIRETORIO, ARQUIVO), true)); writer.write(evento.toString(), 0, evento.toString().length()); writer.newLine(); writer.close(); }catch(FileNotFoundException fnfe){ throw new Exception("Arquivo não encontrado"); }catch(Exception ex){ throw new Exception("Problemas na gravação do arquivo"); } } public Vector<Vector<Object>> getEventos()throws Exception{ Vector<Vector<Object>> lista = new Vector<Vector<Object>>(); try { BufferedReader reader = new BufferedReader(new FileReader (new File(DIRETORIO, ARQUIVO))); String linha = reader.readLine(); while(linha != null){ Vector<Object> eventoVector = new Vector<Object>(); String[] tokens = linha.split(";"); eventoVector.add(tokens[0]); eventoVector.add(tokens[1]); eventoVector.add(PeriodicidadeEnum.valueOf(tokens[2])); eventoVector.add(tokens[3]); eventoVector.add(tokens[4].equals("1") ? "LIGADO" : "DESLIGADO"); lista.add(eventoVector); linha = reader.readLine(); } reader.close(); }catch(FileNotFoundException fnfe){ throw new Exception("Arquivo não encontrado"); }catch(Exception ex){ throw new Exception("Problemas de leitura no arquivo de eventos"); } return lista; } } private void chamaCadastroEvento(){ AgendaIO io = new AgendaIO(); Evento evento = new Evento(); Object[] novaLinha = new Object[5]; evento.setDataEvento(AgendaUtils.getDateFromString(tfDtEvento.getText())); evento.setDescEvento(tfDescEvento.getText()); evento.setAlarme(chckbxAlarme.isSelected() ? 1 : 0); evento.setEmailEncaminhar(tfEmailEvento.getText()); novaLinha[0] = tfDtEvento.getText(); novaLinha[1] = tfDescEvento.getText(); novaLinha[4] = chckbxAlarme.isSelected() ? "LIGADO" : "DESLIGADO"; novaLinha[3] = tfEmailEvento.getText(); if(rdbtnUmaVez.isSelected()){ evento.setPeriodicidade(PeriodicidadeEnum.UNICO); novaLinha[2] = PeriodicidadeEnum.UNICO; } else if(rdbtnSemanal.isSelected()){ evento.setPeriodicidade(PeriodicidadeEnum.SEMANAL); novaLinha[2] = PeriodicidadeEnum.SEMANAL; } else { evento.setPeriodicidade(PeriodicidadeEnum.MENSAL); novaLinha[2] = PeriodicidadeEnum.MENSAL; } try { io.gravarEvento(evento); }catch(Exception ex){ JOptionPane.showMessageDialog(null, "ERRO", ex.getMessage(), JOptionPane.ERROR_MESSAGE); } listaEventos.addNewRow(novaLinha); limparCampos(); }
Exemplo básico de agenda implementada com Spring Boot + Thymeleaf
agenda
API de Lives construída em Spring Boot com MongoDB utilizada no curso de Angular 9.
Config files for my GitHub profile.
projeto de cadastro
Projeto Kotlin Android do canal YouTube "Emagrecer de Vez". Projeto que faz uso do framework Android YouTuber App do Blog Thiengo.com.br
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.