Пример #1
0
 private void setupScrollBar() {
   if (is64Bit) {
     // 64-bit mode
     scrollBar =
         new HighPrecisionJScrollBar(
             Scrollbar.VERTICAL,
             new BigInteger(
                 1,
                 new byte[] {
                   (byte) 0x80, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                   (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
                 }),
             new BigInteger(
                 1,
                 new byte[] {
                   (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                   (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
                 }),
             new BigInteger(
                 1,
                 new byte[] {
                   (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
                   (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC
                 }));
     scrollBar.setUnitIncrementHP(
         new BigInteger(
             1,
             new byte[] {
               (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
               (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x08
             }));
     scrollBar.setBlockIncrementHP(
         new BigInteger(
             1,
             new byte[] {
               (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
               (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x40
             }));
   } else {
     // 32-bit mode
     scrollBar =
         new HighPrecisionJScrollBar(
             Scrollbar.VERTICAL,
             new BigInteger(1, new byte[] {(byte) 0x80, (byte) 0x00, (byte) 0x00, (byte) 0x00}),
             new BigInteger(1, new byte[] {(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00}),
             new BigInteger(1, new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC}));
     scrollBar.setUnitIncrementHP(
         new BigInteger(1, new byte[] {(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x04}));
     scrollBar.setBlockIncrementHP(
         new BigInteger(1, new byte[] {(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x20}));
   }
   scrollBar.addChangeListener(
       new ChangeListener() {
         public void stateChanged(ChangeEvent e) {
           updateFromScrollBar();
         }
       });
 }