首页 \ 问答 \ Java - JFrame上只有两个圆角(Java - Only Two Rounded Corners on a JFrame)

Java - JFrame上只有两个圆角(Java - Only Two Rounded Corners on a JFrame)

我想围绕JFrame的前两个角来围绕我正在进行的项目。 我目前使用setShape(new RoundRectangle2D.Double(0, 0, 200, 252, 30, 30));舍入所有四个角setShape(new RoundRectangle2D.Double(0, 0, 200, 252, 30, 30)); 但我不希望底部两个圆形我想要成为一个正常的角落。


I would like to round the top two corners on a JFrame for a project I am currently working on. I am currently rounding all four corners using setShape(new RoundRectangle2D.Double(0, 0, 200, 252, 30, 30)); but I do not want the bottom two rounded I want the to be a normal corner.


原文:
更新时间:2022-02-10 20:02

最满意答案

Firefox检查此代码段

此代码段仅适用于Firefox ..

编辑

我也创建了在Firefox显示的plunker,请检查一下

Firefox Plunker

.b4-test {
  padding: 50px;
  width: 500px;
  margin: 50px auto;
  text-align: center;
  background: #ccc;
}
.progress[value] {
  border-radius: 0;
  background-color: red;
}
.progress[value]::-moz-progress-bar {
  background-color: green;
}
<div class="b4-test">
  <progress class="progress" value="75" max="100">75%</progress>
</div>

对于Chrome,请检查以下plunker

检查这个Chrome Plunker


Check this snippet in Firefox

This snippet will work in Firefox only..

Edit

I have also created plunker to show in Firefox please check this

Firefox Plunker

.b4-test {
  padding: 50px;
  width: 500px;
  margin: 50px auto;
  text-align: center;
  background: #ccc;
}
.progress[value] {
  border-radius: 0;
  background-color: red;
}
.progress[value]::-moz-progress-bar {
  background-color: green;
}
<div class="b4-test">
  <progress class="progress" value="75" max="100">75%</progress>
</div>

For Chrome check the below plunker

check this Chrome Plunker

相关问答

更多