J
Justin
heres the code i am using...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.font.*;
import java.text.Collator;
import javax.swing.event.*;
import java.util.Date;
import java.text.DateFormat;
class ExamKnee2 extends JDialog{
JLabel textKneeSocietyScore;
JButton btnOK;
ExamModuleFollowups followup;
ExamModuleExamKnee examKnee;
ExamModuleActivity activity;
ExamModulePainGrade painGrade;
ExamModuleSymptoms symptoms;
Color bgColor = Color.YELLOW;
final int WIDTH = 830;
AccessConnection dataConnection = new AccessConnection();
public String sSN, side;
JPanel panel;
JScrollPane scroller;
public ExamKnee2(String stringSide, String stringSSN, String
timePain) {
side = stringSide;
sSN = stringSSN;
setModal(true);
Container pane = this.getContentPane();
this.setAlwaysOnTop(true);
pane.setLayout(new BorderLayout());
//pane.setLayout(null);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setBounds(300,0,WIDTH,600);
addWidgets();
setVisible(true);
validate();
}
public void addWidgets(){
panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setSize(400, 1000);
JLabel testing = new JLabel("testing1");
panel.add(testing, BorderLayout.PAGE_START);
JLabel testing2 = new JLabel("testing2");
panel.add(testing, BorderLayout.CENTER);
JLabel testing3 = new JLabel("testing3");
panel.add(testing2, BorderLayout.PAGE_END);
scroller = new JScrollPane(panel);
scroller.setSize(100,100);
add(scroller, BorderLayout.LINE_START);
}
public static void main(String args[]){
ExamKnee2 examKnee = new ExamKnee2("Right", "123-45-6789", "2
weeks");
}
}
All I am trying to do is get the scroll pane to scroll vertically.
Will not do it. This is really pissing me off. According to the java
tutorial (found here
http://java.sun.com/docs/books/tutorial/uiswing/layout/border.html)
the "testing" labels should be displayed horizontally. Secondly, I
should be able to scroll around to view the 3rd testing label but I
cant. I know theres more problems but im a lil piissed off right now
becuase this isnt working. please help...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.font.*;
import java.text.Collator;
import javax.swing.event.*;
import java.util.Date;
import java.text.DateFormat;
class ExamKnee2 extends JDialog{
JLabel textKneeSocietyScore;
JButton btnOK;
ExamModuleFollowups followup;
ExamModuleExamKnee examKnee;
ExamModuleActivity activity;
ExamModulePainGrade painGrade;
ExamModuleSymptoms symptoms;
Color bgColor = Color.YELLOW;
final int WIDTH = 830;
AccessConnection dataConnection = new AccessConnection();
public String sSN, side;
JPanel panel;
JScrollPane scroller;
public ExamKnee2(String stringSide, String stringSSN, String
timePain) {
side = stringSide;
sSN = stringSSN;
setModal(true);
Container pane = this.getContentPane();
this.setAlwaysOnTop(true);
pane.setLayout(new BorderLayout());
//pane.setLayout(null);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setBounds(300,0,WIDTH,600);
addWidgets();
setVisible(true);
validate();
}
public void addWidgets(){
panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setSize(400, 1000);
JLabel testing = new JLabel("testing1");
panel.add(testing, BorderLayout.PAGE_START);
JLabel testing2 = new JLabel("testing2");
panel.add(testing, BorderLayout.CENTER);
JLabel testing3 = new JLabel("testing3");
panel.add(testing2, BorderLayout.PAGE_END);
scroller = new JScrollPane(panel);
scroller.setSize(100,100);
add(scroller, BorderLayout.LINE_START);
}
public static void main(String args[]){
ExamKnee2 examKnee = new ExamKnee2("Right", "123-45-6789", "2
weeks");
}
}
All I am trying to do is get the scroll pane to scroll vertically.
Will not do it. This is really pissing me off. According to the java
tutorial (found here
http://java.sun.com/docs/books/tutorial/uiswing/layout/border.html)
the "testing" labels should be displayed horizontally. Secondly, I
should be able to scroll around to view the 3rd testing label but I
cant. I know theres more problems but im a lil piissed off right now
becuase this isnt working. please help...