Postingan terdahulu tentang Interface
Dibawah ini merupakan full codingnya
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ipodgui; import javax.swing.Timer; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class IpodGUI extends javax.swing.JFrame implements ActionListener{ private static final long serialVersionUID = 1L; int statusMp3=0,volumeMp3=0,trackMp3=0; private static final int RATE = 12; private final Timer timer = new Timer(1000 / RATE, this); public IpodGUI() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") //private void initComponents() { jPanel1 = new javax.swing.JPanel(); JudulPanel = new javax.swing.JPanel(); JudulLabel = new javax.swing.JLabel(); UrutanLaguPanel = new javax.swing.JPanel(); UrutanLaguTxt = new javax.swing.JTextField(); UrutanLaguLabel = new javax.swing.JLabel(); JudulLagu = new javax.swing.JPanel(); JudulLaguTxt = new javax.swing.JTextField(); JudulLaguLabel = new javax.swing.JLabel(); prevBtn = new javax.swing.JButton(); NextBtn = new javax.swing.JButton(); playBtn = new javax.swing.JButton(); TambahVolumeBtn = new javax.swing.JButton(); KurangVolumeBtn = new javax.swing.JButton(); InputOutputPanel = new javax.swing.JPanel(); InputOutputBtn = new javax.swing.JButton(); OnOffPanel = new javax.swing.JPanel(); OnOffLabel = new javax.swing.JLabel(); VolumePanel = new javax.swing.JPanel(); VolumeTxt = new javax.swing.JTextField(); VolumeLabel = new javax.swing.JLabel(); pauseBtn = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(new java.awt.Color(0, 153, 153)); jPanel1.setBackground(new java.awt.Color(0, 0, 204)); JudulPanel.setBackground(new java.awt.Color(0, 0, 0)); JudulLabel.setBackground(new java.awt.Color(204, 204, 204)); JudulLabel.setFont(new java.awt.Font("Tekton Pro", 1, 24)); // NOI18N JudulLabel.setForeground(new java.awt.Color(102, 0, 204)); JudulLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); JudulLabel.setText("MP3 Player"); javax.swing.GroupLayout JudulPanelLayout = new javax.swing.GroupLayout(JudulPanel); JudulPanel.setLayout(JudulPanelLayout); JudulPanelLayout.setHorizontalGroup( JudulPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(JudulPanelLayout.createSequentialGroup() .addGap(19, 19, 19) .addComponent(JudulLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 338, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(12, Short.MAX_VALUE)) ); JudulPanelLayout.setVerticalGroup( JudulPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JudulPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(JudulLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE) .addContainerGap()) ); UrutanLaguPanel.setBackground(new java.awt.Color(0, 51, 51)); UrutanLaguTxt.setHorizontalAlignment(javax.swing.JTextField.LEFT); javax.swing.GroupLayout UrutanLaguPanelLayout = new javax.swing.GroupLayout(UrutanLaguPanel); UrutanLaguPanel.setLayout(UrutanLaguPanelLayout); UrutanLaguPanelLayout.setHorizontalGroup( UrutanLaguPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(UrutanLaguPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(UrutanLaguTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE) .addContainerGap()) ); UrutanLaguPanelLayout.setVerticalGroup( UrutanLaguPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(UrutanLaguTxt, javax.swing.GroupLayout.Alignment.TRAILING) ); UrutanLaguLabel.setText("Urutan Lagu"); JudulLagu.setBackground(new java.awt.Color(0, 51, 51)); JudulLaguTxt.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { JudulLaguTxtActionPerformed(evt); } }); javax.swing.GroupLayout JudulLaguLayout = new javax.swing.GroupLayout(JudulLagu); JudulLagu.setLayout(JudulLaguLayout); JudulLaguLayout.setHorizontalGroup( JudulLaguLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(JudulLaguLayout.createSequentialGroup() .addContainerGap() .addComponent(JudulLaguTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE) .addContainerGap()) ); JudulLaguLayout.setVerticalGroup( JudulLaguLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(JudulLaguTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE) ); JudulLaguLabel.setText("Judul Lagu"); prevBtn.setBackground(new java.awt.Color(51, 255, 0)); prevBtn.setText("Prev"); prevBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { prevBtnActionPerformed(evt); } }); NextBtn.setBackground(new java.awt.Color(51, 255, 0)); NextBtn.setText("Next"); NextBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { NextBtnActionPerformed(evt); } }); playBtn.setBackground(new java.awt.Color(51, 255, 0)); playBtn.setText("Play"); playBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { playBtnActionPerformed(evt); } }); TambahVolumeBtn.setBackground(new java.awt.Color(51, 255, 0)); TambahVolumeBtn.setText("+"); TambahVolumeBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { TambahVolumeBtnActionPerformed(evt); } }); KurangVolumeBtn.setBackground(new java.awt.Color(51, 255, 0)); KurangVolumeBtn.setText("-"); KurangVolumeBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { KurangVolumeBtnActionPerformed(evt); } }); InputOutputPanel.setBackground(new java.awt.Color(0, 51, 51)); InputOutputBtn.setBackground(new java.awt.Color(51, 255, 0)); InputOutputBtn.setFont(new java.awt.Font("Tekton Pro Cond", 1, 36)); // NOI18N InputOutputBtn.setText("I/O"); InputOutputBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { InputOutputBtnActionPerformed(evt); } }); javax.swing.GroupLayout InputOutputPanelLayout = new javax.swing.GroupLayout(InputOutputPanel); InputOutputPanel.setLayout(InputOutputPanelLayout); InputOutputPanelLayout.setHorizontalGroup( InputOutputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, InputOutputPanelLayout.createSequentialGroup() .addContainerGap(21, Short.MAX_VALUE) .addComponent(InputOutputBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(19, 19, 19)) ); InputOutputPanelLayout.setVerticalGroup( InputOutputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, InputOutputPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(InputOutputBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(23, 23, 23)) ); OnOffPanel.setBackground(new java.awt.Color(0, 0, 51)); OnOffLabel.setFont(new java.awt.Font("Tahoma", 2, 18)); // NOI18N OnOffLabel.setForeground(new java.awt.Color(255, 255, 255)); javax.swing.GroupLayout OnOffPanelLayout = new javax.swing.GroupLayout(OnOffPanel); OnOffPanel.setLayout(OnOffPanelLayout); OnOffPanelLayout.setHorizontalGroup( OnOffPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(OnOffPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(OnOffLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 44, Short.MAX_VALUE) .addContainerGap()) ); OnOffPanelLayout.setVerticalGroup( OnOffPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(OnOffPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(OnOffLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); VolumePanel.setBackground(new java.awt.Color(0, 51, 51)); javax.swing.GroupLayout VolumePanelLayout = new javax.swing.GroupLayout(VolumePanel); VolumePanel.setLayout(VolumePanelLayout); VolumePanelLayout.setHorizontalGroup( VolumePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(VolumePanelLayout.createSequentialGroup() .addContainerGap() .addComponent(VolumeTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE) .addContainerGap()) ); VolumePanelLayout.setVerticalGroup( VolumePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(VolumePanelLayout.createSequentialGroup() .addContainerGap() .addComponent(VolumeTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE) .addContainerGap()) ); VolumeLabel.setText("Volume"); pauseBtn.setBackground(new java.awt.Color(51, 255, 0)); pauseBtn.setText("Pause"); pauseBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pauseBtnActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(13, 13, 13) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(prevBtn) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(playBtn) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pauseBtn)) .addComponent(JudulLaguLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(NextBtn) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(OnOffPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(InputOutputPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(UrutanLaguLabel) .addComponent(UrutanLaguPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(10, 10, 10) .addComponent(JudulLagu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(KurangVolumeBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(TambahVolumeBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(VolumePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(VolumeLabel) .addGap(15, 15, 15)))) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(JudulPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(45, 45, 45)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(JudulPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(JudulLaguLabel) .addComponent(UrutanLaguLabel)) .addComponent(VolumeLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(VolumePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(JudulLagu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(UrutanLaguPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(pauseBtn) .addComponent(playBtn) .addComponent(prevBtn) .addComponent(NextBtn))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(TambahVolumeBtn) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(KurangVolumeBtn))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(OnOffPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(InputOutputPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(78, 78, 78)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 416, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 11, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE)) ); pack(); }// private void InputOutputBtnActionPerformed(java.awt.event.ActionEvent evt) { if(statusMp3==0){ statusMp3=1; OnOffLabel.setText("On"); }else if(statusMp3==1){ statusMp3=0; OnOffLabel.setText("Off"); } } private void TambahVolumeBtnActionPerformed(java.awt.event.ActionEvent evt) { if(statusMp3==1){ if(volumeMp3>-1 && volumeMp3<100 1="" evt="" if="" java.awt.event.actionevent="" kurangvolumebtnactionperformed="" private="" statusmp3="" void="" volumemp3="" volumetxt.settext="">0){ if(volumeMp3>0 && volumeMp3<=100){ volumeMp3 -= 1; VolumeTxt.setText(volumeMp3+""); } } } private void prevBtnActionPerformed(java.awt.event.ActionEvent evt) { if(statusMp3==1){ if(trackMp3>0 && trackMp3<=5){ trackMp3 -= 1; UrutanLaguTxt.setText(trackMp3+""); }else if(trackMp3==0){ trackMp3 += 5; } } if(statusMp3==1){ if(trackMp3==1){ JudulLaguTxt.setText("Track 01 - David Gueta"); }else if(trackMp3==2){ JudulLaguTxt.setText("Track 02 - Depapepe"); }else if(trackMp3==3){ JudulLaguTxt.setText("Track 03 - The Chainsmoker"); }else if(trackMp3==4){ JudulLaguTxt.setText("Track 04 - Taylor Swift"); }else if(trackMp3==5){ JudulLaguTxt.setText("Track 05 - Ed Sheeran"); } } } private void NextBtnActionPerformed(java.awt.event.ActionEvent evt) { if(statusMp3==1){ if(trackMp3>-1 && trackMp3<5 -="" 01="" 02="" 03="" 04="" 05="" 1="" and="" args="" arguments="" chainsmoker="" command="" david="" defaultstate="collapsed" depapepe="" desc=" Look and feel setting code (optional) " ed="" editor-fold="" else="" evt="" feel="" gueta="" if="" java.awt.event.actionevent="" judullagutxt.settext="" judullagutxtactionperformed="" line="" look="" main="" nimbus="" param="" pausebtnactionperformed="" playbtnactionperformed="" private="" public="" rack="" set="" sheeran="" static="" statusmp3="=1){" swift="" taylor="" the="" timer.start="" timer.stop="" trackmp3="" tring="" urutanlagutxt.settext="" void=""> try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(IpodGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(IpodGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(IpodGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(IpodGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } 5>100>
Saya memberikan penjelasan sedikit tentang kondisinya
if(statusMp3==0){ statusMp3=1; OnOffLabel.setText("On"); }else if(statusMp3==1){ statusMp3=0; OnOffLabel.setText("Off"); } }koding input/output diatas berfungsi untuk menyalakan Mp3 sehingga saya beri nama status Mp3.Nah di statusMp3 ini kita buat defaul value 0 untuk mati dan 1 untuk hidup.
dan kondisinya adalah sebagai berikut : jika status mp3 adalah 0 maka rubah status mp3 dari 0 menjadi 1 atau dari mati ke nyala.Serta Label nya berubah menjadi On atau Off begitu pula sebaliknya.
if(statusMp3==1){ if(volumeMp3>-1 && volumeMp3<100 1="" evt="" if="" java.awt.event.actionevent="" kurangvolumebtnactionperformed="" private="" statusmp3="" void="" volumemp3="" volumetxt.settext="">0){ if(volumeMp3>0 && volumeMp3<=100){ volumeMp3 -= 1; VolumeTxt.setText(volumeMp3+""); } } } 100>
Selanjutnya adalah koding tambah volume atau juga kurang volume.Jika status Mp3==1 maka lanjut ke volumeMp3.Pada volume Mp3 kan track nya ada lima yang saya buat.Lalu volumeMp3 itu variabel awalnya saya mulai dari 1.Sehingga karena kodingan diatas adalah untuk volume down maka volumeMp3 dimulai dari -1 karena jika semisal track kita di 2 lalu volumeMp3 nya akan di -=1 maka akan menjadi 1.Dan selanjutnya jika di -1 lagi maka akan menjadi 1-1 adalah 0.Dan selnjutnya jika di -1 lagi maka tidak bisa karena kondisi nya adalah >-1 bukan >=-1.
<100 1="" evt="" if="" java.awt.event.actionevent="" kurangvolumebtnactionperformed="" private="" statusmp3="" void="" volumemp3="" volumetxt.settext="">if(statusMp3==1){ if(trackMp3==1){ JudulLaguTxt.setText("Track 01 - David Gueta"); }else if(trackMp3==2){ JudulLaguTxt.setText("Track 02 - Depapepe"); }else if(trackMp3==3){ JudulLaguTxt.setText("Track 03 - The Chainsmoker"); }else if(trackMp3==4){ JudulLaguTxt.setText("Track 04 - Taylor Swift"); }else if(trackMp3==5){ JudulLaguTxt.setText("Track 05 - Ed Sheeran"); } } } 100>
Yang selanjutnya adalah List trackMp3 nya.Jika statusMp3 1 atau menyala dan trackMp3==1.Maka setText track yaitu David Gueta.
Sekian dari saya gan.Kalog ada yang bingung tanyakan saja
Download program diatas disini
No comments:
Post a Comment