package com.ogane.xi.test; import java.awt.*; import java.awt.event.*; import com.ogane.xi.Volume; public class VolumeTest extends Frame { public VolumeTest() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); setTitle("VolumeTest"); setLayout(null); setBackground(new Color(220, 211, 200)); setResizable(true); // ----- ----- Volume vol1 = new Volume(); vol1.setNumMinorTicks(1); vol1.setBounds(20, 30, 150, 130); add(vol1); // ----- E ----- Volume vol2 = new Volume(); vol2.setMaximum(2.0); vol2.setMinimum(-2.0); vol2.setNumTicks(9, 4); vol2.setKnobColor(new Color(200, 200, 255)); vol2.setTickLabelFormat("0.0"); vol2.setBounds(180, 30, 160, 130); add(vol2); Label label=new Label("Ctrl key: Slow / Shift key: Fast"); label.setBounds(80, 140, 300, 80); add(label); setSize(360, 200); setVisible(true); } protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } public static void main(String[] args) { new VolumeTest(); } }