diff --git a/build.gradle b/build.gradle index 05200ef..bec504d 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ clean { delete "bin" } -task createPom << { +task createPom doLast { pom { project { groupId 'org.jcommunique' diff --git a/src/main/java/com/notification/types/WindowNotification.java b/src/main/java/com/notification/types/WindowNotification.java index 2f53b31..d85cc00 100644 --- a/src/main/java/com/notification/types/WindowNotification.java +++ b/src/main/java/com/notification/types/WindowNotification.java @@ -5,8 +5,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JPanel; -import javax.swing.JWindow; +import javax.swing.*; import com.notification.Notification; import com.theme.WindowTheme; @@ -44,7 +43,7 @@ public void mouseClicked(MouseEvent e) { }; setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); - setPanel(new JPanel()); + setPanel((new JPanel())); } protected JWindow getWindow() { @@ -63,6 +62,17 @@ protected void setPanel(JPanel panel) { m_panel.addMouseListener(m_listener); } + public void setScrollBarToPanel() + { + if(m_panel != null) + { + m_window.remove(m_panel); + JScrollPane scrollPane = new JScrollPane(m_panel); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + m_window.add(scrollPane); + } + } /** * @return whether or not the Notification should close when it's clicked */