当前位置: 首页>>代码示例>>Java>>正文


Java JScrollPane.setBounds方法代码示例

本文整理汇总了Java中javax.swing.JScrollPane.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollPane.setBounds方法的具体用法?Java JScrollPane.setBounds怎么用?Java JScrollPane.setBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JScrollPane的用法示例。


在下文中一共展示了JScrollPane.setBounds方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createColumnViewArea

import javax.swing.JScrollPane; //导入方法依赖的package包/类
private JScrollPane createColumnViewArea()
{
    JScrollPane scroll_colEdit = new JScrollPane();
    scroll_colEdit.setViewportView(m_tblColView);
    scroll_colEdit.setBounds(m_scrollTblName.getWidth() + GuiConstants.GAP_COMPONENT, m_nYOffsetInRightPane,
                             s_nRightPaneWidth, 300);

    m_nYOffsetInRightPane += (scroll_colEdit.getHeight() + GuiConstants.GAP_COMPONENT);

    return scroll_colEdit;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:12,代码来源:TableGui.java

示例2: ManualPanel

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public ManualPanel() {
    this.addComponentListener( this );
    this.setLayout( null );
    manualTextArea.setWrapStyleWord( true );

    manualTextArea.setText( readManual() );
    manualTextArea.setEditable( false );
    scrollPane = new JScrollPane( manualTextArea );
    scrollPane.setPreferredSize( new Dimension( 800, 534 ) );
    scrollPane.setBounds( BORDERLINE, BORDERLINE, 800, 534 );
    this.setPreferredSize( new Dimension( 800, 534 ) );
    this.setBackground( BG_COLOR );
    manualTextArea.setForeground( TEXT_COLOR );
    manualTextArea.setBackground( BG_COLOR );
    manualTextArea.setLineWrap( true );
    this.add( scrollPane );
}
 
开发者ID:lauriholmas,项目名称:batmapper,代码行数:18,代码来源:ManualPanel.java

示例3: CourseListPanel

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Create the panel.
 */
public CourseListPanel(String user,ProfessorFrame pf) throws Exception{
	setLayout(new BorderLayout(0, 0));
       TableCellRenderer buttonRenderer = new ButtonRenderer();
	dao = new ProfessorDAO();
	model=new tableModelTeach(dao.getAllCourses(user),user,pf);
	table = new JTable();
	table.setRowHeight(30);
	
	table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	table.setDefaultRenderer(JButton.class,buttonRenderer);
	table.addMouseListener(new JTableButtonMouseListener(table));
	table.setModel(model);
	JScrollPane scrollPane = new JScrollPane(table,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	//resizeColumnWidth(table);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	TableColumnModel tcm = table.getColumnModel();
	tcm.getColumn(0).setPreferredWidth(800);    
	tcm.getColumn(1).setPreferredWidth(200);    
	
	scrollPane.setBounds(10, 57, 1320, 450);
	add(scrollPane, BorderLayout.CENTER);
}
 
开发者ID:jtatia,项目名称:Course-Management-System,代码行数:26,代码来源:CourseListPanel.java

示例4: GraphValidationPanel

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public GraphValidationPanel() {
		setSize(new Dimension(900, 300));
		setPreferredSize(new Dimension(900, 300));
		setMinimumSize(new Dimension(450, 300));
		setLayout(null);
		
		JLabel lblValidationResults = new JLabel("Validation Results");
		lblValidationResults.setBounds(12, 12, 137, 15);
		add(lblValidationResults);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(12, 39, 876, 212);
		add(scrollPane);
		
		table = new JTable();
		table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
		scrollPane.setViewportView(table);
		
//		btnRevalidate = new JButton("Revalidate");
//		btnRevalidate.setBounds(12, 263, 117, 25);
//		add(btnRevalidate);
	}
 
开发者ID:roscisz,项目名称:KernelHive,代码行数:23,代码来源:GraphValidationPanel.java

示例5: loadScene

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@Override
public void loadScene(Container container) {
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBounds(0, 0, 784, 461);
	container.add(scrollPane);

	JTextPane textPane = new JTextPane();
	textPane.setFont(new Font("Tahoma", Font.PLAIN, 12));
	for (int i = 0; i < 50; i++) {
		textPane.setText(textPane.getText() + "\n" + i);
	}
	scrollPane.setViewportView(textPane);
}
 
开发者ID:Cyphereion,项目名称:Java-Swing-Helper,代码行数:14,代码来源:SceneText.java

示例6: createPartControl

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@Override
public void createPartControl(final Composite parent) {
  final Object viewer = Test.getViewer();

  final Composite composite = new Composite(parent, SWT.EMBEDDED);
  final Frame frame = SWT_AWT.new_Frame(composite);
  frame.setTitle("Antlr AST");

  scrollPane = new JScrollPane();
  scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
  scrollPane.setBounds(0, 0, 500, 500);

  scrollPane.getViewport().add((Component) viewer);

  frame.add(scrollPane);
  // frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.setSize(Toolkit.getDefaultToolkit().getScreenSize().width, 500);
  frame.setVisible(true);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:21,代码来源:ParseTreeView.java

示例7: initialize

import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void initialize() {
	txtArea = new JTextArea();
	txtArea.setFont(new Font(Font.SANS_SERIF, 0, 12));
	txtArea.setEditable(false);
	JScrollPane sp = new JScrollPane(txtArea);
	sp.setBounds(5, 5, 600, 410);
	frame.getContentPane().add(sp);
	
	btnOk = new JButton("OK");
	btnOk.setFont(new Font(Font.SANS_SERIF, 0, 12));
	btnOk.setBounds(510, 420, 95, 20);
	btnOk.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			frame.dispose();
		}
	});
	frame.getContentPane().add(btnOk);
	
	txtArea.append(new Utils().getLicenseFile());
	txtArea.setCaretPosition(0);
}
 
开发者ID:JudgeGlass,项目名称:Install_Builder_Universal,代码行数:22,代码来源:GNULicenseWindow.java

示例8: iniciaJTable

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Método responsável por inicializar JTable
*
*/
private void iniciaJTable() {
	tableTransacoes = new JTable();
	tableTransacoes.setModel(new DefaultTableModel(new Object[][] {},
	retornaNomeColunas()));
	tableTransacoes.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	tableTransacoes.setBounds(703, 24, -690, 140);
	tableTransacoes.getTableHeader().setReorderingAllowed(false);
	panelTransacoes.setLayout(null);
	JScrollPane scrollPane = new JScrollPane(tableTransacoes);
	scrollPane.setViewportView(tableTransacoes);
	scrollPane.setBounds(10, 21, 691, 154);
	panelTransacoes.add(scrollPane);
}
 
开发者ID:alexferreiradev,项目名称:3way_laboratorios,代码行数:18,代码来源:OperacoesBanco.java

示例9: initialize

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    frame = new JFrame("Library Book Loan System - All Users");
    frame.setResizable(false);
    frame.setBounds(100, 100, 588, 400);
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    
    JPanel panel = new JPanel();
    frame.getContentPane().add(panel, BorderLayout.CENTER);
    panel.setLayout(null);
    
    JLabel lblAllBooks = new JLabel("All Users");
    lblAllBooks.setHorizontalAlignment(SwingConstants.CENTER);
    lblAllBooks.setFont(new Font("Segoe UI Light", Font.PLAIN, 14));
    lblAllBooks.setBounds(10, 40, 564, 22);
    panel.add(lblAllBooks);
    
    JLabel label_1 = new JLabel("Library Book Loan System");
    label_1.setHorizontalAlignment(SwingConstants.CENTER);
    label_1.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
    label_1.setBounds(10, 11, 564, 25);
    panel.add(label_1);
    
    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(10, 73, 564, 257);
    panel.add(scrollPane);
    
    Object columnNames[] = { "Username", "Email", "User Role"};
    DefaultTableModel model = new DefaultTableModel(1, columnNames.length);
    model.setColumnIdentifiers(columnNames);

    table = new JTable(model) {
        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };

    scrollPane.setViewportView(table);

    List<User> userList = UserController.getInstance().getAllUsers();

    ((DefaultTableModel) table.getModel()).removeRow(0);

    for (User user : userList) {
        ((DefaultTableModel) table.getModel()).addRow(
                new Object[]{user.getUsername(), user.getEmail(), user.getRole().toString()});
    }
    
    JLabel lblBooks = new JLabel(userList.size() + " User(s)");
    lblBooks.setBounds(528, 336, 46, 14);
    panel.add(lblBooks);
}
 
开发者ID:hisener,项目名称:bbm487s2017g1,代码行数:56,代码来源:LibrarianAllUsers.java

示例10: showParseTree

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public static void showParseTree(final FOLParser parser, final ParseTree t) {

    final JFrame frame = new JFrame("Antlr AST");

    final JScrollPane scrollPane = new JScrollPane();
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setBounds(0, 0, 500, 500);

    final TreeViewer viewr = new TreeViewer(Arrays.asList(parser.getRuleNames()), t);
    viewr.setScale(0.8); // scale a little
    scrollPane.getViewport().add(viewr);

    frame.add(scrollPane);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(Toolkit.getDefaultToolkit().getScreenSize().width, 500);
    frame.setVisible(true);
  }
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:19,代码来源:Utilities.java

示例11: addFileList

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void addFileList() {
	fileModel = new DefaultListModel();
	fileList = new JList(fileModel);
	fileList.setFont(new Font(Font.SANS_SERIF, 0, 12));
	JScrollPane sp = new JScrollPane(fileList);
	sp.setBounds(5, 35, 350, 200);
	frame.getContentPane().add(sp);
}
 
开发者ID:JudgeGlass,项目名称:Install_Builder_Universal,代码行数:10,代码来源:InstallBuilderWindow.java

示例12: addDirList

import javax.swing.JScrollPane; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void addDirList() {
	dirModel = new DefaultListModel();
	dirList = new JList(dirModel);
	dirList.setFont(new Font(Font.SANS_SERIF, 0, 12));
	JScrollPane sp = new JScrollPane(dirList);
	sp.setBounds(445, 35, 360, 200);
	frame.getContentPane().add(sp);
}
 
开发者ID:JudgeGlass,项目名称:Install_Builder_Universal,代码行数:10,代码来源:InstallBuilderWindow.java

示例13: setup

import javax.swing.JScrollPane; //导入方法依赖的package包/类
public void setup(){
	JTextArea conComp = new JTextArea();  
	JScrollPane scrollPane = new JScrollPane(conComp);
	scrollPane.setBounds(21, 204, 228, 33);
	contentPane.add(scrollPane);
	MessageConsole mc = new MessageConsole(conComp);
		mc.redirectOut();
		mc.redirectErr(Color.RED, null);
		mc.setMessageLines(100);
}
 
开发者ID:Nik4053,项目名称:KSP-AGuS-Automatic-Guidance-System,代码行数:11,代码来源:GUI_CONSOLE.java

示例14: CollectionPanel

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Create the panel.
 */
public CollectionPanel() {
	setLayout(null);
	
	collection = new ArrayList<String>();
	
	txtSearch = new JTextField();
	txtSearch.setToolTipText("Search...");
	txtSearch.setBounds(208, 29, 278, 28);
	add(txtSearch);
	txtSearch.setColumns(100);
	
	btnSearch = new JButton("Search");
	btnSearch.setBounds(506, 30, 117, 29);
	add(btnSearch);
	
	JLabel lblSearch = new JLabel("Search:");
	lblSearch.setFont(new Font("Lucida Grande", Font.PLAIN, 25));
	lblSearch.setBounds(108, 23, 88, 31);
	add(lblSearch);
	
	btnCraft = new JButton("Craft");
	btnCraft.setBounds(245, 266, 117, 29);
	add(btnCraft);
	
	btnDust = new JButton("Dust");
	btnDust.setBounds(374, 266, 117, 29);
	add(btnDust);
	
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBounds(23, 73, 646, 181);
	add(scrollPane);
	
	list = new JList<String>(collection_model);
	list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	scrollPane.setViewportView(list);
	
	btnBack = new JButton("Back");
	btnBack.setBounds(22, 266, 117, 29);
	add(btnBack);
	
	lblDust = new JLabel("Dust:");
	lblDust.setHorizontalAlignment(SwingConstants.TRAILING);
	lblDust.setBounds(563, 271, 106, 16);
	add(lblDust);
	
}
 
开发者ID:ikhaliq15,项目名称:JHearthstone,代码行数:50,代码来源:CollectionPanel.java

示例15: MakeDeckPanel

import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
 * Create the panel.
 */
public MakeDeckPanel() {
	setLayout(null);
	
	JLabel lblDecklist = new JLabel("Decklist: ");
	lblDecklist.setBounds(434, 6, 60, 16);
	add(lblDecklist);
	
	JLabel lblCollection = new JLabel("Collection:");
	lblCollection.setBounds(30, 22, 68, 16);
	add(lblCollection);
	
	btnDelete = new JButton("Delete");
	btnDelete.setBounds(434, 271, 117, 29);
	add(btnDelete);
	
	btnAdd = new JButton("Add");
	btnAdd.setBounds(213, 271, 117, 29);
	add(btnAdd);
	
	btnSave = new JButton("Save");
	btnSave.setBounds(547, 271, 117, 29);
	add(btnSave);
	
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBounds(444, 34, 220, 235);
	add(scrollPane);
	
	deck_list = new JList<String>(model);
	deck_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	scrollPane.setViewportView(deck_list);
	
	JScrollPane scrollPane_1 = new JScrollPane();
	scrollPane_1.setBounds(30, 56, 377, 214);
	add(scrollPane_1);
	
	collection = new JList<String>(collection_model);
	collection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	scrollPane_1.setViewportView(collection);
	
	btnBack = new JButton("Back");
	btnBack.setBounds(81, 271, 117, 29);
	add(btnBack);
	
	textField = new JTextField();
	textField.setBounds(110, 16, 180, 28);
	add(textField);
	textField.setColumns(10);
	
	btnSearch = new JButton("Search");
	btnSearch.setBounds(290, 17, 117, 29);
	add(btnSearch);

}
 
开发者ID:ikhaliq15,项目名称:JHearthstone,代码行数:57,代码来源:MakeDeckPanel.java


注:本文中的javax.swing.JScrollPane.setBounds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。