简体   繁体   English

输出分数作为分子在java中的分母?

[英]Output fraction as numerator over denominator in java?

I am working on a scientific calculator in java for which I need to output a fraction in its actual form like as numerator over denominator. 我正在研究java中的科学计算器,我需要以实际形式输出一个分数,如分母分母。 Currently I am using JTextField to output my expressions.I know that this is not possible with JTextField, kindly guide me how this is possible ? 目前我正在使用JTextField输出我的表达式。我知道这对JTextField是不可能的,请指导我如何做到这一点?

new JLabel("<html>2 <sup>2</sup>&frasl;<sub>3</sub></html>")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取以分数的“分子/分母”形式返回分数的字符串版本的方法 - How to get method which returns the String version of the Fraction in the form of “numerator / denominator” of fraction 有理数的方法-分子和分母 - Method to Rational - numerator and denominator 如何将浮点数转换为由字节分子和分母表示的最接近的分数? - How can I turn a floating point number into the closest fraction represented by a byte numerator and denominator? 正则表达式(分数的分母) - Regular expressions (denominator of a fraction) 正则表达式获得x / y比率的分子和分母 - regex to get numerator and denominator for a ratio x/y 将 double 转换为 BigRational(两个 BigInteger 用于分子/分母) - Convert double into BigRational (two BigInteger for numerator/denominator) 这个方法如何计算 Rational(1).hashCode()? 1 的分子或分母是 1 本身 - How does this method compute Rational(1).hashCode()? The numerator or denominator of 1 is 1 itself 较弱的数学技能:什么是8位分子和8位分母? - Weak Math Skillset: What is an 8-bit numerator and 8-bit denominator? Java中的分数 - Fraction in Java 在Java-意外输出中将二进制/十进制小数转换为十六进制 - converting binary/decimal fraction to hexadecimal in java -unexpected output
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM