diff --git a/.gitignore b/.gitignore
index 7f59e8c..93b824f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
-twitter4j.properties
\ No newline at end of file
+twitter4j.properties
+/TASK6/nbproject/private/
+/TASK6/build/
\ No newline at end of file
diff --git a/TASK6/build.xml b/TASK6/build.xml
new file mode 100644
index 0000000..8fa014e
--- /dev/null
+++ b/TASK6/build.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project TASK6.
+
+
+
diff --git a/TASK6/manifest.mf b/TASK6/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/TASK6/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/TASK6/nbproject/build-impl.xml b/TASK6/nbproject/build-impl.xml
new file mode 100644
index 0000000..a68a028
--- /dev/null
+++ b/TASK6/nbproject/build-impl.xml
@@ -0,0 +1,1420 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No tests executed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set profile.class
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+ Must select some files in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+ Must select one file in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TASK6/nbproject/genfiles.properties b/TASK6/nbproject/genfiles.properties
new file mode 100644
index 0000000..0d6abfd
--- /dev/null
+++ b/TASK6/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=9549b760
+build.xml.script.CRC32=bf06c440
+build.xml.stylesheet.CRC32=8064a381@1.80.1.48
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=9549b760
+nbproject/build-impl.xml.script.CRC32=f4149b8e
+nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
diff --git a/TASK6/nbproject/project.properties b/TASK6/nbproject/project.properties
new file mode 100644
index 0000000..a87fdb8
--- /dev/null
+++ b/TASK6/nbproject/project.properties
@@ -0,0 +1,75 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processor.options=
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/TASK6.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${libs.twitter4j-core-4.0.4.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.external.vm=true
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=task6.Driver
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/TASK6/nbproject/project.xml b/TASK6/nbproject/project.xml
new file mode 100644
index 0000000..6086ff4
--- /dev/null
+++ b/TASK6/nbproject/project.xml
@@ -0,0 +1,15 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ TASK6
+
+
+
+
+
+
+
+
+
diff --git a/TASK6/src/task6/ComposeTweet.form b/TASK6/src/task6/ComposeTweet.form
new file mode 100644
index 0000000..57096c7
--- /dev/null
+++ b/TASK6/src/task6/ComposeTweet.form
@@ -0,0 +1,101 @@
+
+
+
diff --git a/TASK6/src/task6/ComposeTweet.java b/TASK6/src/task6/ComposeTweet.java
new file mode 100644
index 0000000..d3af31b
--- /dev/null
+++ b/TASK6/src/task6/ComposeTweet.java
@@ -0,0 +1,121 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+import java.awt.event.ActionListener;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public class ComposeTweet extends javax.swing.JFrame implements View{
+
+ /**
+ * Creates new form ComposeTeweer
+ */
+ public ComposeTweet() {
+ initComponents();
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jScrollPane1 = new javax.swing.JScrollPane();
+ txAreaTweet = new javax.swing.JTextArea();
+ jLabel1 = new javax.swing.JLabel();
+ btnCancel = new javax.swing.JButton();
+ btnTweet = new javax.swing.JButton();
+ jLabel2 = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ txAreaTweet.setColumns(20);
+ txAreaTweet.setRows(5);
+ jScrollPane1.setViewportView(txAreaTweet);
+
+ jLabel1.setText("Compose new Tweet...");
+
+ btnCancel.setText("Cancel");
+
+ btnTweet.setText("Tweet");
+
+ jLabel2.setText("140");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addGap(0, 0, Short.MAX_VALUE))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(btnCancel)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(btnTweet)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1)
+ .addGap(4, 4, 4)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(btnCancel)
+ .addComponent(btnTweet)
+ .addComponent(jLabel2))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ /**
+ * @param args the command line arguments
+ */
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnCancel;
+ private javax.swing.JButton btnTweet;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextArea txAreaTweet;
+ // End of variables declaration//GEN-END:variables
+
+ public Object getBtnCancel(){
+ return btnCancel;
+ }
+
+ public Object getBtntweet(){
+ return btnTweet;
+ }
+
+ public String getTweet(){
+ return txAreaTweet.getText();
+ }
+
+ @Override
+ public void addListener(ActionListener e){
+ btnCancel.addActionListener(e);
+ btnTweet.addActionListener(e);
+ }
+}
diff --git a/TASK6/src/task6/Controller.java b/TASK6/src/task6/Controller.java
new file mode 100644
index 0000000..b8b2ae8
--- /dev/null
+++ b/TASK6/src/task6/Controller.java
@@ -0,0 +1,122 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.JOptionPane;
+import task6.View;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public class Controller implements ActionListener {
+
+ private TwitterModel model;
+ private View view;
+ private String currentView;
+ private Jpanel mainPanel;
+
+ private HomeTimeline h;
+ private ComposeTweet c;
+ private FollowUser f;
+
+ public Controller() {
+ model = new TwitterModel();
+ goToHomeTimeline();
+
+ h = new HomeTimeline();
+ c = new ComposeTweet();
+ f = new FollowUser();
+
+ h.addListener(this);
+ c.addListener(this);
+ f.addListener(this);
+
+ mainPanel = view.getmainPanel;
+
+
+ }
+
+ public void goToHomeTimeline() {
+ HomeTimeline home = new HomeTimeline();
+ home.setVisible(true);
+ home.addListener(this);
+ home.setTimeline(model.getHomeTimeline());
+ view = home;
+ }
+
+ private void goToComposeTweet() {
+ ComposeTweet compose = new ComposeTweet();
+ compose.setVisible(true);
+ compose.addListener(this);
+ view = compose;
+ }
+
+ private void goToFollowUser() {
+ FollowUser follow = new FollowUser();
+ follow.setVisible(true);
+ follow.addListener(this);
+ view = follow;
+
+ }
+
+ public void actionPerformed(ActionEvent ae) {
+ Object source = ae.getSource();
+
+ try {
+ HomeTimeline home = (HomeTimeline) view;
+ if (source.equals(home.getBtnCompose())) {
+ goToComposeTweet();
+ home.dispose();
+
+ } else if (source.equals(home.getBtnFollow())) {
+ goToFollowUser();
+ home.dispose();
+
+ } else if (source.equals(home.getBtnRefresh())) {
+ String timeline = model.getHomeTimeline();
+ home.setTimeline(timeline);
+
+ } else if (source.equals(home.getBtnExit())) {
+ JOptionPane.showMessageDialog(null, "Thank You");
+ System.exit(0);
+ }
+
+ ComposeTweet compose = (ComposeTweet) view;
+
+ if (source.equals(compose.getBtnCancel())) {
+ goToHomeTimeline();
+ compose.dispose();
+
+ } else if (source.equals(compose.getBtntweet())) {
+ String tweet = compose.getTweet();
+ model.tweetStatus(tweet);
+ goToHomeTimeline();
+ compose.dispose();
+ }
+
+
+ FollowUser follow = (FollowUser) view;
+ if (source.equals(follow.getBtnCancel())) {
+ goToHomeTimeline();
+ follow.dispose();
+ } else if (source.equals(follow.getBtnFollow())) {
+ String user = follow.getUser();
+ model.followUser(user);
+ follow.setUser("");
+ }
+
+ } catch (Exception e) {
+ JOptionPane.showMessageDialog((Component) view, e.getMessage());
+ }
+ }
+}
+
+
+
diff --git a/TASK6/src/task6/Driver.java b/TASK6/src/task6/Driver.java
new file mode 100644
index 0000000..4b32da9
--- /dev/null
+++ b/TASK6/src/task6/Driver.java
@@ -0,0 +1,16 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public class Driver {
+ public static void main(String[] args) {
+ Controller a = new Controller();
+ }
+}
diff --git a/TASK6/src/task6/FollowUser.form b/TASK6/src/task6/FollowUser.form
new file mode 100644
index 0000000..9540652
--- /dev/null
+++ b/TASK6/src/task6/FollowUser.form
@@ -0,0 +1,80 @@
+
+
+
diff --git a/TASK6/src/task6/FollowUser.java b/TASK6/src/task6/FollowUser.java
new file mode 100644
index 0000000..0559cb0
--- /dev/null
+++ b/TASK6/src/task6/FollowUser.java
@@ -0,0 +1,112 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+import java.awt.event.ActionListener;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public class FollowUser extends javax.swing.JFrame implements View{
+
+ /**
+ * Creates new form FollowerUser
+ */
+ public FollowUser() {
+ initComponents();
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ txFieldUser = new javax.swing.JTextField();
+ jLabel1 = new javax.swing.JLabel();
+ btnCancel = new javax.swing.JButton();
+ btnFollow = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ jLabel1.setText("Follow User");
+
+ btnCancel.setText("Cancel");
+
+ btnFollow.setText("Follow");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(txFieldUser)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addGap(0, 0, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(btnCancel)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 78, Short.MAX_VALUE)
+ .addComponent(btnFollow)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(14, 14, 14)
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(txFieldUser, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(btnCancel)
+ .addComponent(btnFollow))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ /**
+ * @param args the command line arguments
+ */
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnCancel;
+ private javax.swing.JButton btnFollow;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JTextField txFieldUser;
+ // End of variables declaration//GEN-END:variables
+
+
+ public Object getBtnCancel(){
+ return btnCancel;
+ }
+
+ public Object getBtnFollow(){
+ return btnFollow;
+ }
+
+ public String getUser(){
+ return txFieldUser.getText();
+ }
+
+ public void setUser(String s){
+ txFieldUser.setText(s);
+ }
+
+ public void addListener(ActionListener e){
+ btnCancel.addActionListener(e);
+ btnFollow.addActionListener(e);
+ }
+}
diff --git a/TASK6/src/task6/HomeTimeline.form b/TASK6/src/task6/HomeTimeline.form
new file mode 100644
index 0000000..931405c
--- /dev/null
+++ b/TASK6/src/task6/HomeTimeline.form
@@ -0,0 +1,100 @@
+
+
+
diff --git a/TASK6/src/task6/HomeTimeline.java b/TASK6/src/task6/HomeTimeline.java
new file mode 100644
index 0000000..598d808
--- /dev/null
+++ b/TASK6/src/task6/HomeTimeline.java
@@ -0,0 +1,133 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+import java.awt.event.ActionListener;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public class HomeTimeline extends javax.swing.JFrame implements View{
+
+ /**
+ * Creates new form HomeTimeline
+ */
+ public HomeTimeline() {
+ initComponents();
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jScrollPane1 = new javax.swing.JScrollPane();
+ txAreaTimeline = new javax.swing.JTextArea();
+ btnCompose = new javax.swing.JButton();
+ btnFollow = new javax.swing.JButton();
+ btnRefresh = new javax.swing.JButton();
+ btnExit = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ txAreaTimeline.setEditable(false);
+ txAreaTimeline.setColumns(20);
+ txAreaTimeline.setRows(5);
+ jScrollPane1.setViewportView(txAreaTimeline);
+
+ btnCompose.setText("Compose");
+
+ btnFollow.setText("Follow User");
+
+ btnRefresh.setText("Refresh");
+
+ btnExit.setText("Exit");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(btnCompose)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(btnFollow)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(btnRefresh)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(btnExit)
+ .addGap(0, 0, Short.MAX_VALUE)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(btnCompose)
+ .addComponent(btnFollow)
+ .addComponent(btnRefresh)
+ .addComponent(btnExit))
+ .addContainerGap(48, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ /**
+ * @param args the command line arguments
+ */
+
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnCompose;
+ private javax.swing.JButton btnExit;
+ private javax.swing.JButton btnFollow;
+ private javax.swing.JButton btnRefresh;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextArea txAreaTimeline;
+ // End of variables declaration//GEN-END:variables
+
+
+ public Object getBtnCompose(){
+ return btnCompose;
+ }
+
+ public Object getBtnFollow(){
+ return btnFollow;
+ }
+
+ public Object getBtnRefresh(){
+ return btnRefresh;
+ }
+
+ public Object getBtnExit(){
+ return btnExit;
+ }
+
+ public void setTimeline (String s){
+ txAreaTimeline.setText(s);
+ }
+
+ @Override
+ public void addListener(ActionListener e){
+ btnCompose.addActionListener(e);
+ btnExit.addActionListener(e);
+ btnFollow.addActionListener(e);
+ btnRefresh.addActionListener(e);
+ }
+}
diff --git a/TASK6/src/task6/PanelContainer.form b/TASK6/src/task6/PanelContainer.form
new file mode 100644
index 0000000..e6cfa53
--- /dev/null
+++ b/TASK6/src/task6/PanelContainer.form
@@ -0,0 +1,105 @@
+
+
+
diff --git a/TASK6/src/task6/PanelContainer.java b/TASK6/src/task6/PanelContainer.java
new file mode 100644
index 0000000..a96bdb1
--- /dev/null
+++ b/TASK6/src/task6/PanelContainer.java
@@ -0,0 +1,129 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+//import java.awt.CardLayout;
+import java.awt.event.ActionListener;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public class PanelContainer extends javax.swing.JFrame implements View{
+
+ private CardLayout cardLayout;
+
+ public PanelContainer() {
+ initComponents();
+ cardLayout = new CardLayout();
+ mainPanel.setLayout(cardLayout);
+ }
+ public JPanel getMainPanel() {
+ return mainPanel;
+ }
+
+ public CardLayout getCardLayout() {
+ return cardLayout;
+ }
+
+ public Object getBtnExit() {
+ return btnExit;
+ }
+
+ public void addListener(ActionListener e) {
+ btnExit.addActionListener(e);
+ }
+
+ public void viewErrorMsg(String errorMsg) {
+ JOptionPane.showMessageDialog(this, errorMsg);
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel1 = new javax.swing.JPanel();
+ mainPanel = new javax.swing.JPanel();
+ btnExit = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ mainPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+
+ javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 0, Short.MAX_VALUE)
+ );
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 206, Short.MAX_VALUE)
+ );
+
+ btnExit.setText("exit");
+
+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
+ .addGap(0, 309, Short.MAX_VALUE)
+ .addComponent(btnExit)))
+ .addContainerGap())
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(mainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(btnExit)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ /**
+ * @param args the command line arguments
+ */
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnExit;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JPanel mainPanel;
+ // End of variables declaration//GEN-END:variables
+
+}
diff --git a/TASK6/src/task6/TwitterModel.java b/TASK6/src/task6/TwitterModel.java
new file mode 100644
index 0000000..5fd9a2b
--- /dev/null
+++ b/TASK6/src/task6/TwitterModel.java
@@ -0,0 +1,55 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+import twitter4j.*;
+import java.util.List;
+import javax.swing.JOptionPane;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public class TwitterModel {
+ private Twitter twitter;
+
+ public TwitterModel() {
+ twitter = new TwitterFactory().getInstance();
+ }
+
+ public void tweetStatus(String tweet){
+ try {
+ twitter.updateStatus(tweet);
+ JOptionPane.showMessageDialog(null, "pesan berhasil");
+ } catch (Exception e){
+ JOptionPane.showMessageDialog(null, "judul exception", "pesan exception", JOptionPane.ERROR_MESSAGE);
+ }
+}
+ public String getHomeTimeline(){
+ try {
+ String s = " ";
+ List status = twitter.getHomeTimeline();
+ for (int i = 0; i< status.size(); i++ ){
+ s = s+ status.get(i).getUser().getScreenName()+ " - "
+ + status.get(i).getText()+ "\n\n";
+ }
+ return s;
+ } catch (Exception e){
+ JOptionPane.showMessageDialog(null, "judul exception", "pesan exception", JOptionPane.ERROR_MESSAGE);
+ }
+ return null;
+ }
+
+ public void followUser(String user) {
+ try {
+ twitter.createFriendship(user);
+ } catch (Exception e){
+ JOptionPane.showMessageDialog(null, "judul exception", "pesan exception", JOptionPane.ERROR_MESSAGE);
+ }
+
+ }
+
+}
diff --git a/TASK6/src/task6/View.java b/TASK6/src/task6/View.java
new file mode 100644
index 0000000..8bee16a
--- /dev/null
+++ b/TASK6/src/task6/View.java
@@ -0,0 +1,21 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package task6;
+
+import java.awt.event.ActionListener;
+import javax.swing.JPanel;
+
+/**
+ *
+ * @author abdulnursahid
+ */
+public interface View {
+ public void addListener(ActionListener e);
+
+ public JPanel getMainPanel();
+ }
+
+
diff --git a/TASK6/twitter4j-core-4.0.4.jar b/TASK6/twitter4j-core-4.0.4.jar
new file mode 100644
index 0000000..029abce
Binary files /dev/null and b/TASK6/twitter4j-core-4.0.4.jar differ