Blockchain blockchain = UIEthereumManager.ethereum.getBlockchain();
long blockNum = Long.parseLong(blockNumberText.getText());
if (blockNum > blockchain.getSize() - 1) {
blockNum = blockchain.getSize() - 1;
}
Block block = blockchain.getBlockByNumber(blockNum);
blockN.setText("" + block.getNumber());
highlightText(blockN);
minGasPrice.setText("" + block.getMinGasPrice());
highlightText(minGasPrice);
gasLimit.setText("" + block.getGasLimit());
highlightText(gasLimit);
gasUsed.setText("" + block.getGasUsed());
highlightText(gasUsed);
timestamp.setText(Utils.longToDateTime(block.getTimestamp()));
highlightText(timestamp);
difficulty.setText(ByteUtil.toHexString(block.getDifficulty()));
highlightText(difficulty);
hash.setText(ByteUtil.toHexString(block.getHash()));
highlightText(hash);
parentHash.setText(ByteUtil.toHexString(block.getParentHash()));
highlightText(parentHash);
uncleHash.setText(ByteUtil.toHexString(block.getUnclesHash()));
highlightText(uncleHash);
stateRoot.setText(ByteUtil.toHexString(block.getStateRoot()));
highlightText(stateRoot);
trieRoot.setText(ByteUtil.toHexString(block.getTxTrieRoot()));
highlightText(trieRoot);
coinbase.setText(ByteUtil.toHexString(block.getCoinbase()));
highlightText(coinbase);
nonce.setText(ByteUtil.toHexString(block.getNonce()));
highlightText(nonce);
if (block.getExtraData() != null) {
extraData.setText(ByteUtil.toHexString(block.getExtraData()));
highlightText(extraData);
}
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
transactionsPanel.removeAll();
int row = 1;
for (Transaction transaction : block.getTransactionsList()) {
JPanel transactionPanel = createTransactionPanel(blockchainTable, transaction);
c.gridx = 0;
c.gridy = row;
c.weighty = 1;