final JPanel panel = new JPanel();
final JFrame frame = this.createSmallFrame(panel, "Enter Query...");
// create components for query input with syntax highlighting...
final LuposDocument document = new LuposDocument();
final JTextPane tp_query = new LuposJTextPane(document);
document.init(SPARQLParser.createILuposParser(new LuposDocumentReader(document)), false, 100);
tp_query.addKeyListener(this.getKeyListener(frame));
tp_query.setFont(new Font("Courier New", Font.PLAIN, 12));
tp_query.setPreferredSize(new Dimension(794, 200));
tp_query.setText("PREFIX dc: <http://purl.org/dc/elements/1.1/>\nPREFIX dcterms: <http://purl.org/dc/terms/>\n\nSELECT DISTINCT ?author ?yr\nWHERE {\n ?doc1 dc:author ?author.\n ?doc1 dc:ref ?doc2.\n ?doc2 dc:ref ?doc3.\n ?doc3 dc:ref ?doc1.\n OPTIONAL {\n ?doc1 dcterms:issued ?yr. FILTER(?yr < 1950)\n }\n}\nORDER BY ASC(?author)");
new LinePainter(tp_query, new Color(202, 223, 245));
final JScrollPane scroll = new JScrollPane(tp_query);
// create OK button, which starts query evaluation...
final JButton bt_ok = new JButton("OK");
bt_ok.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent ae) {
try {
visualGraphs.get(0).clearAll();
// evaluate query and show graph...
evaluateQuery(tp_query.getText());
repaint();
frame.setVisible(false); // hide query input frame