I am creating a note taking application using Java.
What I want to do:
I want to increase the size of the text inside textAreaeach time I click on the size of the increase. I will know how to do the opposite.
Short code:
JButton incButton = new JButton("+");
fontFrame.add(incButton);
incButton.addActionListener(new fontIncAction());
JButton DecButton = new JButton("-");
fontFrame.add(DecButton);
}
}
private class fontIncAction implements ActionListener{
public void actionPerformed(ActionEvent e){
textArea.setFont(new Font("Serif",Font.PLAIN,20));
}
}
source
share