Well I'm going through a lot of my code and wanting to clean it up a bit by creating functions to do the necessary tasks instead of having code that is multiple lines long.
For example, I use the following code multiple times
ViewObject vo = new ViewObject(a, b, c, d, e, f);
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = row;
gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
jPanel.add(vo, gridBagConstraints);
So if I wanted to create a function to take care of this but be able to change the viewobject, gridy, and panel what would the function look like?
I know the parameters would be something like:
public void constraints(int row, Object object, JPanel panel){
}
Basically I'm just looking for how to make gridy = row, vo = object, jPanel = panel and my mind seems to be coming up with a blank