All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bdi.tutorial.TranslationGuiF1 Maven / Gradle / Ivy

Go to download

The Jadex BDI applications package contain several example applications, benchmarks and testcases using BDI agents.

There is a newer version: 2.4
Show newest version
package jadex.bdi.tutorial;

import jadex.commons.gui.SGUI;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;

/**
 *  The gui showing translation actions.
 */
public class TranslationGuiF1 extends JFrame
{
	//-------- attributes --------

	/** The list of all requests served. */
	protected DefaultTableModel tadata;

	//-------- constructors --------

	/**
	 *  Create a new gui.
	 */
	public TranslationGuiF1()
	{
		// create the gui.
		tadata	= new DefaultTableModel(new String[]{"Action", "Language", "Content", "Translation"}, 0);
		JTable tatable = new JTable(tadata);
		JScrollPane sp = new JScrollPane(tatable);
		this.getContentPane().add("Center", sp);
		this.pack();
		this.setLocation(SGUI.calculateMiddlePosition(this));
		this.setVisible(true);
	}

	//-------- methods --------

	/**
	 *  Add some content as new row in the table.
	 *  @param content The content.
	 */
	public void addRow(final String[] content)
	{
		SwingUtilities.invokeLater(new Runnable()
		{
			public void run()
			{
				tadata.addRow(content);
			}
		});
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy