Bug 151666 - Missing method in javax/swing/text/JTextComponent: viewToModel(Point)
Summary: Missing method in javax/swing/text/JTextComponent: viewToModel(Point)
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Thomas Fitzsimmons
QA Contact:
URL: http://java.sun.com/j2se/1.4.2/docs/a...
Whiteboard:
Keywords:
: 150772 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-21 16:03 UTC by Andrew Overholt
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-31 15:43:00 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Andrew Overholt 2005-03-21 16:03:23 UTC
Description of problem:
While trying to compile oldrhino (from JPackage), I ran into a missing method in
libgcj's JTextComponent:  viewToModel(java.awt.Point).

Version-Release number of selected component (if applicable):
libgcj-4.0.0-0.34

How reproducible:
Always.

Steps to Reproduce:
1. Here's an example of a class that uses this:

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;

public class Test extends JFrame {
	private JTextArea fileTextArea;

	private JButton getButton;

	public static void main(String[] args) {
		Frame f = new Test();
		f.show();
	}

	public Test() {
		Container contentPane = getContentPane();

		fileTextArea = new JTextArea(24, 80);
		getButton = new JButton("Press me");
		getButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				getButtonPressed();
			}
		});

		contentPane.add(fileTextArea, BorderLayout.CENTER);
		contentPane.add(getButton, BorderLayout.SOUTH);

		pack();

		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});
	}

	public void getButtonPressed() {
		int position = fileTextArea.viewToModel(fileTextArea
				.getLocationOnScreen());
		System.out.println(position);
	}
}

2. javac Test.java
  
Actual results:
2. ERROR in Test.java
 (at line 47)
        int position = fileTextArea.viewToModel(fileTextArea
                                    ^^^^^^^^^^^
The method viewToModel(Point) is undefined for the type JTextArea

Expected results:
No output.

Comment 1 Thomas Fitzsimmons 2005-03-31 15:38:33 UTC
*** Bug 150772 has been marked as a duplicate of this bug. ***

Comment 2 Thomas Fitzsimmons 2005-03-31 15:43:00 UTC
Fixed in gcc CVS HEAD and gcc-4_0-branch.  I'll ping Jakub to make sure this
patch goes into the FC4test2 gcc rpms.



Note You need to log in before you can comment on or make changes to this bug.