WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('in-progress') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('pending') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

Spinners | Loop and Break

Spinners

You might be wondering just what a spinner is. It’s a new 1.4 component similar to the JComboBox, but it shows only one item. It includes up and down arrows to “scroll” through its set of values. A JFormattedTextField is used to edit and render those values. Spinners are quite flexible. They work nicely with a set of choices (such as the months of the year) as well as with unbounded ranges such as a set of integers.

import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.util.List;

class RolloverSpinnerListModel extends SpinnerListModel {

	public RolloverSpinnerListModel(Object[] items) {
		super(items);
	}

	public RolloverSpinnerListModel(List items) {
		super(items);
	}

	public Object getNextValue() {
		Object nv = super.getNextValue();
		if (nv != null) {
			return nv;
		}
		return getList().get(0);
	}

	public Object getPreviousValue() {
		Object pv = super.getPreviousValue();
		if (pv != null) {
			return pv;
		}
		List l = getList();
		return l.get(l.size() - 1);
	}
}

public class SpinnerTest extends JFrame {

	public SpinnerTest() {
		super("JSpinner Test");
		setSize(300, 180);
		setDefaultCloseOperation(EXIT_ON_CLOSE);

		Container c = getContentPane();
		c.setLayout(new GridLayout(0, 2));

		c.add(new JLabel(" Basic Spinner"));
		c.add(new JSpinner());

		c.add(new JLabel(" Date Spinner"));
		c.add(new JSpinner(new SpinnerDateModel()));

		String weekdays[] = new String[] { "Sunday", "Monday", "Tuesday",
				"Wednesday", "Thursday", "Friday", "Saturday" };
		c.add(new JLabel(" List Spinner"));
		c.add(new JSpinner(new SpinnerListModel(weekdays)));

		c.add(new JLabel(" Number Spinner"));
		c.add(new JSpinner(new SpinnerNumberModel(0, 0, 100, 5)));

		c.add(new JLabel(" Rollover List Spinner"));
		c.add(new JSpinner(new RolloverSpinnerListModel(weekdays)));

		setVisible(true);
	}

	public static void main(String args[]) {
		new SpinnerTest();
	}
}
Share

You may also like...