I would like to know how to access mongodb database from a scala swing application. I am new to scala.I have created a database named mydb in mongodb and a collection named studen(rollno,name,age,city). I simply want to perform insert, update and delete with swing on a mongodb database, but i have no idea which package to use and any other information that can be useful.
I am attching the swing code here.
Gui.scala
import swing._
import swing.event._
import swing.Component._
object Gui extends SimpleSwingApplication
{
def top = new MainFrame {
title = "Second Swing App"
val combobox = new ComboBox(List(("1"),("2"),("3"),("4"),("5"),("6"))){
}
val text1= new TextField(10){
}
val text2= new TextField(10){
}
val text3= new TextField(10){
}
val button = new Button {
text = "Clear"
}
val button1 = new Button {
text = "Save"
}
val button2 = new Button {
text = "Delete"
}
val button3 = new Button {
text = "Update"
}
val label = new Label {
text = "No button clicks registered"
}
contents = new BoxPanel(Orientation.Vertical) {
contents += combobox
contents += text1
contents += text2
contents += text3
contents += button
contents += label
contents += button1
contents += button2
contents += button3
border = Swing.EmptyBorder(30, 30, 10, 30)
}
listenTo(button)
reactions+={
case ButtonClicked(button)=>
}
}