import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants;
import javax.swing.JButton;
+
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
+
import javax.swing.JTextPane;
import businessLogic.HouseManager;
+import businessLogic.HouseManagerInterface;
public class NewHouseGUI extends JFrame {
btnRegister.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try {
- HouseManager hm = new HouseManager();
+ HouseManagerInterface hm = new HouseManager();
+ //TODO when the house is not added show a warning to the user. Method below returns a boolean stating that.
hm.registerNewHouse(Integer.parseInt(Code_f.getText()),
owner, description_f.getText(),
Town_f.getText() ,Integer.parseInt(rooms_f.getText()),
.addGap(18)
.addComponent(rooms_f, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
.addGroup(gl_contentPane.createSequentialGroup()
- .addGap(26)
+ .addGap(18)
.addComponent(lblParkings, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(parkings_f, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(885, Short.MAX_VALUE))
+ .addContainerGap(97, Short.MAX_VALUE))
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(3)
.addComponent(lblKitchen)))
- .addPreferredGap(ComponentPlacement.RELATED, 206, Short.MAX_VALUE)
+ .addPreferredGap(ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(3)