TavernerPOS - Source Code

Clone: 

git clone http://www.librarysmith.co.uk/tavernerPOS

 

package com.floreantpos.actions;

import java.awt.Window;

import com.floreantpos.POSConstants;
import com.floreantpos.demo.KitchenDisplayWindow;

public class ShowKitchenDisplayAction extends PosAction {

	public ShowKitchenDisplayAction() {
		super(POSConstants.KITCHEN_DISPLAY_BUTTON_TEXT); //$NON-NLS-1$
	}

	@Override
	public void execute() {
		Window[] windows = Window.getWindows();
		for (Window window : windows) {
			if(window instanceof KitchenDisplayWindow) {
				window.setVisible(true);
				window.toFront();
				return;
			}
		}

		KitchenDisplayWindow window = new KitchenDisplayWindow();
		window.setVisible(true);
	}

}

Add comment
These comments are moderated so so won't be published until reviewed.