nothing displays for the blockchain downloaded. so that wouldnt work
either. i did add override and still nothing.
package wallettemplate;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.listeners.DownloadProgressTracker;
import org.bitcoinj.kits.WalletAppKit;
import org.bitcoinj.params.TestNet3Params;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MainPage extends JDialog {
public static NetworkParameters params = TestNet3Params.get();
public static WalletAppKit kit = new WalletAppKit(params, new File("."),
"wallet");
public static boolean ModeStatus = true;
public static boolean NetStatus = false;
public static boolean CamStatus = false;
private MainPage parentForm;
private JPanel contentPane;
private JPanel cardPanel;
final static String SPLASH = "Diagnostic";
final static String INDEX = "Index";
final static String PCHOICE = "Purchase Choice";
final static String PURCHASE = "Purchase";
final static String PCONFIRM = "Purchase Confirm";
final static String PPROCESS = "Purchase Process";
final static String REFUND = "Refund";
final static String RAMOUNT = "Refund Amount";
final static String RCHOICE = "Refund Choice";
final static String RCONFIRM = "Refund Confirm";
final static String RPROCESS = "Refund Process";
public void showPanel(String id) {
final CardLayout cl = (CardLayout) cardPanel.getLayout();
cl.show(cardPanel, id);
}
public MainPage(String loadup) {
setContentPane(contentPane);
setLocationRelativeTo(null);
setModal(true);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
Pprocess pprocess = new Pprocess();
pprocess.setParentForm(this);
cardPanel.add(pprocess.getPanel(), PPROCESS);
Pconfirm pconfirm = new Pconfirm(pprocess);
pconfirm.setParentForm(this);
cardPanel.add(pconfirm.getPanel(), PCONFIRM);
Purchase purchase = new Purchase(pconfirm);
purchase.setParentForm(this);
cardPanel.add(purchase.getPanel(), PURCHASE);
Pchoice pchoice = new Pchoice(purchase);
pchoice.setParentForm(this);
cardPanel.add(pchoice.getPanel(), PCHOICE);
Rprocess rprocess = new Rprocess();
rprocess.setParentForm(this);
cardPanel.add(rprocess.getPanel(), RPROCESS);
Rconfirm rconfirm = new Rconfirm(rprocess);
rconfirm.setParentForm(this);
cardPanel.add(rconfirm.getPanel(), RCONFIRM);
Ramount ramount = new Ramount(rconfirm);
ramount.setParentForm(this);
cardPanel.add(ramount.getPanel(), RAMOUNT);
Refund refund = new Refund(ramount, rconfirm);
refund.setParentForm(this);
cardPanel.add(refund.getPanel(), REFUND);
Rchoice rchoice = new Rchoice(refund);
rchoice.setParentForm(this);
cardPanel.add(rchoice.getPanel(), RCHOICE);
Index zero = new Index();
zero.setParentForm(this);
cardPanel.add(zero.getPanel(), INDEX);
Diagnostic diagnostic = new Diagnostic();
diagnostic.setParentForm(this);
cardPanel.add(diagnostic.getPanel(), SPLASH);
final CardLayout cl = (CardLayout) cardPanel.getLayout();
cl.show(cardPanel, loadup);
new dx().start();
}
public static void main(String[] args) throws Exception{
kit.setBlockingStartup(false);
if (ModeStatus) {
kit.startAsync();
kit.awaitRunning();
}
MainPage dialog = new MainPage(SPLASH);
dialog.pack();
dialog.setVisible(true);
System.exit(0);
/*
File chainFile = new File("walletwatch");
if (chainFile.exists()) {
//chainFile.delete();
}
SPVBlockStore chainStore = new SPVBlockStore(params, chainFile);
BlockChain chain = new BlockChain(params, chainStore);
PeerGroup peerGroup = new PeerGroup(params, chain);
peerGroup.addPeerDiscovery(new DnsDiscovery(params));
*/
DownloadProgressTracker bListener = new DownloadProgressTracker() {
@Override
public void doneDownload() {
System.out.println("blockchain downloaded");
}
@Override
public void progress(double pct, int blocksSoFar, Date date) {
System.out.println("blockchain "+(int)pct+"% completed");
}
};
kit.setDownloadListener(bListener);
//peerGroup.start().startBlockChainDownload(bListener);
//peerGroup.start();
//peerGroup.startBlockChainDownload(bListener);
//bListener.await();
}
class dx extends Thread {
public void run() {
boolean dx = true;
while(dx){
if(CamStatus && NetStatus) {
try {
System.out.println("["+new
SimpleDateFormat("HH:mm:ss").format(new
Date())+"]"+BackEnd.strFormat("teal","[DXR]")+" :
"+BackEnd.CamTest()+BackEnd.NetTest()+BackEnd.BTCCheck()+BackEnd.BCHCheck()+BackEnd.ETHCheck()+BackEnd.LTCCheck()+BackEnd.XMRCheck()+BackEnd.DashCheck());
Thread.sleep(3000);
} catch (InterruptedException ex) {
System.out.println("Error: " + ex);
}
}else{
Diagnostic.Hardware = false;
showPanel(SPLASH);
}
}
}
}
public void setParentForm(final MainPage parentForm) {
this.parentForm = parentForm;
}
}
On Monday, May 21, 2018 at 3:53:21 AM UTC-4, Matan Navon wrote:
>
> Try adding the @Override annotation above the progress method
>
> On Mon, May 21, 2018 at 7:59 AM, Bobby_Bouche <[email protected]
> <javascript:>> wrote:
>
>> here is my attempt in this. Still doesnt pick up the percentage update.
>>
>> DownloadProgressTracker bListener = new DownloadProgressTracker() {
>> @Override
>> public void doneDownload() {
>> System.out.println("blockchain downloaded");
>> }
>> public void progress(double pct, int blocksSoFar, Date date) {
>> System.out.println("blockchain "+(int)pct+"% completed");
>> }
>> };
>> kit.setDownloadListener(bListener).setBlockingStartup(false);
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "bitcoinj" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.