Skip to content

Commit

Permalink
removed jtextarea horizontal scroll bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerus M. Aquino committed Oct 3, 2018
1 parent 3f8b3f6 commit 21416e8
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 38 deletions.
76 changes: 49 additions & 27 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified out/production/Haley/Main/Algo.class
Binary file not shown.
Binary file modified out/production/Haley/Main/Interface$1.class
Binary file not shown.
Binary file modified out/production/Haley/Main/Interface$2.class
Binary file not shown.
Binary file modified out/production/Haley/Main/Interface.class
Binary file not shown.
3 changes: 2 additions & 1 deletion src/Main/Algo.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ public class Algo extends Interface {
public int img;
// brute force algorithm
public String reply(String statement) {
String h = "Haley: ";
String haley = statement;
haley = haley.toLowerCase();
String str = new String();

if (haley.contains("what is lifehack") || haley.contains("definition") || haley.contains("what is life hack") || haley.contains("meaning of life hack") || haley.contains("meaning of lifehack")) {
str = "Haley: Lifehacks are strategy or techniques adopted in order to manage one's time and daily activities in a more efficient way. \n";
str = h + "Lifehacks are strategy or techniques adopted in order to manage one's time and daily activities in a more efficient way. \n";
img = 1;
} else {
str = "Haley: ?\n";
Expand Down
13 changes: 3 additions & 10 deletions src/Main/Interface.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public class Interface {
public JFrame frame;

public void init() {
int horizontalPolicy = JScrollPane.HORIZONTAL_SCROLLBAR_NEVER;
int verticalPolicy = JScrollPane.VERTICAL_SCROLLBAR_NEVER;
// ui.setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
// ui.setMaximumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
// ui.setMinimumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
Expand Down Expand Up @@ -58,17 +56,12 @@ public void keyPressed(KeyEvent arg0) {
message.setColumns(10);

// Conversation History
convo = new TextArea();
JScrollPane scroll = new JScrollPane(convo);
// DefaultCaret caret = (DefaultCaret) convo.getCaretPosition();
// caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
convo = new TextArea(null, 4 , 99 , TextArea.SCROLLBARS_VERTICAL_ONLY);

convo.setEditable(false);
convo.setBounds(31, 376, 375, 126);
// convo.setEnabled(false);
scroll.setHorizontalScrollBarPolicy(horizontalPolicy);
scroll.setVerticalScrollBarPolicy(verticalPolicy);
frame.getContentPane().add(scroll);
// frame.getContentPane().add(convo);
frame.getContentPane().add(convo);

// Set Life Hack Picture
pic = new JLabel();
Expand Down

0 comments on commit 21416e8

Please sign in to comment.