private void txtEdgeCostKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtEdgeCostKeyPressed
        if (evt.getKeyCode() == 10) {
            if (!txtVertexName.getText().isEmpty() && txtVertexName.getText().length() != 0) {
                drawing.addVertex(txtVertexName.getText());
                txtVertexName.setText("");
            }
            int cost = 1;
            if (!txtEdgeCost.getText().isEmpty()) {
                cost = Integer.parseInt(txtEdgeCost.getText());
            }
            drawing.addEdge(cost);
            txtEdgeCost.setText("");
            txtVertexName.requestFocus();
        }
    }//GEN-LAST:event_txtEdgeCostKeyPressed